super.onDestroy();
}
@Override
- protected void setupProfileColors() {
- final int profileColor = Data.retrieveCurrentThemeIdFromDb();
- Colors.setupTheme(this, profileColor);
- Colors.profileThemeId = profileColor;
- }
- @Override
protected void onResume() {
super.onResume();
fabShouldShow();
@SuppressLint("Registered")
public class ProfileThemedActivity extends CrashReportingActivity {
protected MobileLedgerProfile mProfile;
+ private boolean themeSetUp = false;
+ private boolean mIgnoreProfileChange;
protected void setupProfileColors() {
final int themeHue = (mProfile == null) ? -1 : mProfile.getThemeHue();
+
Colors.setupTheme(this, themeHue);
+
+ if (themeSetUp)
+ this.recreate();
+ themeSetUp = true;
+
+ Colors.profileThemeId = Data.retrieveCurrentThemeIdFromDb();
}
@Override
protected void onStart() {
protected void onCreate(@Nullable Bundle savedInstanceState) {
initProfile();
setupProfileColors();
+
+ mIgnoreProfileChange = true;
Data.observeProfile(this, profile -> {
- mProfile = profile;
- setupProfileColors();
+ if (!mIgnoreProfileChange) {
+ mProfile = profile;
+ setupProfileColors();
+ }
+
+ mIgnoreProfileChange = false;
});
super.onCreate(savedInstanceState);