From: Damyan Ivanov Date: Thu, 9 Sep 2021 19:56:46 +0000 (+0300) Subject: (unsuccessful) attempt to avoid black flicker when switching profiles X-Git-Tag: v0.20.1~1 X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=commitdiff_plain;h=751aaa5b5283931ca7a221127a3737402d3c6b84 (unsuccessful) attempt to avoid black flicker when switching profiles --- diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileThemedActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileThemedActivity.java index dcc83460..b9726492 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileThemedActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileThemedActivity.java @@ -57,8 +57,11 @@ public class ProfileThemedActivity extends CrashReportingActivity { Colors.setupTheme(this, mThemeHue); if (themeSetUp) { - Logger.debug(TAG, "setupProfileColors(): theme already set up, recreating activity"); - this.recreate(); + Logger.debug(TAG, + "setupProfileColors(): theme already set up, supposedly the activity will be " + + "recreated"); +// this.recreate(); + return; } themeSetUp = true; @@ -79,10 +82,10 @@ public class ProfileThemedActivity extends CrashReportingActivity { } mProfile = profile; + storeProfilePref(profile); int hue = profile.getTheme(); if (hue != mThemeHue) { - storeProfilePref(profile); Logger.debug(TAG, String.format(Locale.US, "profile observer calling setupProfileColors(%d)", hue)); @@ -111,6 +114,7 @@ public class ProfileThemedActivity extends CrashReportingActivity { BaseDAO.runAsync(() -> initProfileSync(profileId)); } private void initProfileSync(long profileId) { + Logger.debug(TAG, String.format(Locale.US, "Loading profile %d", profileId)); ProfileDAO dao = DB.get() .getProfileDAO(); Profile profile = dao.getByIdSync(profileId);