]> git.ktnx.net Git - mobile-ledger.git/commitdiff
fix status bar background when switching profiles (and themes)
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 20 May 2020 19:31:16 +0000 (22:31 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 20 May 2020 19:39:41 +0000 (22:39 +0300)
it appears that if there is a theme defined in the app manifest, the
status bar takes its background from there when the activity is
recreate()'d after a profile/theme change

however, this needs that the theme is set up before the AppCompatActivity's
onCreate() is called

app/src/main/AndroidManifest.xml
app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileThemedActivity.java

index c7e09ef25b94a1ef944380b9ad1f7399a49979b5..c0ec9059c16917d93f3feb8874300cc799cc54ee 100644 (file)
@@ -29,7 +29,6 @@
         android:roundIcon="@mipmap/app_icon"
         android:supportsRtl="true"
         android:networkSecurityConfig="@xml/network_security_config"
-        android:theme="@style/AppTheme"
         tools:ignore="GoogleAppIndexingWarning">
         <activity
             android:name=".ui.activity.MainActivity"
index 77a9272bf9880494b52987c65db457c08bb22711..6d2fff0b477919503ecdfb9bf3b758c99b05a013 100644 (file)
@@ -40,9 +40,9 @@ public class ProfileThemedActivity extends CrashReportingActivity {
     }
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         initProfile();
+        setupProfileColors();
         super.onCreate(savedInstanceState);
 
-        setupProfileColors();
 
         Data.profile.observe(this, mobileLedgerProfile -> {
             mProfile = mobileLedgerProfile;