- static final int waitSlice = 200;
- protected MobileLedgerProfile mProfile;
- protected void setupProfileColors() {
- Colors.setupTheme(this, mProfile);
+ public static final String TAG = "prf-thm-act";
+ protected static final String PARAM_PROFILE_ID = "profile-id";
+ protected static final String PARAM_THEME = "theme";
+ protected Profile mProfile;
+ private boolean themeSetUp = false;
+ private boolean mIgnoreProfileChange;
+ private int mThemeHue;
+ protected void setupProfileColors(int newHue) {
+ if (themeSetUp && newHue == mThemeHue) {
+ Logger.debug(TAG,
+ String.format(Locale.ROOT, "Ignore request to set theme to the same value (%d)",
+ newHue));
+ return;
+ }
+
+ Logger.debug(TAG,
+ String.format(Locale.ROOT, "Changing theme from %d to %d", mThemeHue, newHue));
+
+ mThemeHue = newHue;
+ Colors.setupTheme(this, mThemeHue);
+
+ if (themeSetUp) {
+ Logger.debug(TAG,
+ "setupProfileColors(): theme already set up, supposedly the activity will be " +
+ "recreated");
+// this.recreate();
+ return;
+ }
+ themeSetUp = true;
+
+ Colors.profileThemeId = mThemeHue;