From 751aaa5b5283931ca7a221127a3737402d3c6b84 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Thu, 9 Sep 2021 22:56:46 +0300 Subject: [PATCH] (unsuccessful) attempt to avoid black flicker when switching profiles --- .../ui/activity/ProfileThemedActivity.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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); -- 2.39.5