summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c392329)
was broken if the theme is changed via the profile editor invoked by
the "configure profile" button in the new transaction activity
super.onDestroy();
}
@Override
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();
protected void onResume() {
super.onResume();
fabShouldShow();
@SuppressLint("Registered")
public class ProfileThemedActivity extends CrashReportingActivity {
protected MobileLedgerProfile mProfile;
@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();
protected void setupProfileColors() {
final int themeHue = (mProfile == null) ? -1 : mProfile.getThemeHue();
Colors.setupTheme(this, themeHue);
Colors.setupTheme(this, themeHue);
+
+ if (themeSetUp)
+ this.recreate();
+ themeSetUp = true;
+
+ Colors.profileThemeId = Data.retrieveCurrentThemeIdFromDb();
}
@Override
protected void onStart() {
}
@Override
protected void onStart() {
protected void onCreate(@Nullable Bundle savedInstanceState) {
initProfile();
setupProfileColors();
protected void onCreate(@Nullable Bundle savedInstanceState) {
initProfile();
setupProfileColors();
+
+ mIgnoreProfileChange = true;
Data.observeProfile(this, profile -> {
Data.observeProfile(this, profile -> {
- mProfile = profile;
- setupProfileColors();
+ if (!mIgnoreProfileChange) {
+ mProfile = profile;
+ setupProfileColors();
+ }
+
+ mIgnoreProfileChange = false;
});
super.onCreate(savedInstanceState);
});
super.onCreate(savedInstanceState);