]> git.ktnx.net Git - mobile-ledger.git/commitdiff
avoid duplicate theme setup upon startup and profile+theme change
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 3 May 2019 15:21:25 +0000 (18:21 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 3 May 2019 16:11:44 +0000 (19:11 +0300)
app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java

index e63090366a36e1eeb8a4d74caea544100144bf40..ec8c6fbe97d90d42a53ac1f4b20132af2abd4cbb 100644 (file)
@@ -139,12 +139,15 @@ public class MainActivity extends ProfileThemedActivity {
         super.onDestroy();
     }
     @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        debug("flow", "MainActivity.onCreate()");
+    protected void setupProfileColors() {
         int profileColor = Data.retrieveCurrentThemeIdFromDb();
         Colors.setupTheme(this, profileColor);
         Colors.profileThemeId = profileColor;
+    }
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        debug("flow", "MainActivity.onCreate()");
         setContentView(R.layout.activity_main);
 
         fab = findViewById(R.id.btn_add_transaction);
@@ -421,8 +424,6 @@ public class MainActivity extends ProfileThemedActivity {
         scheduleDataRetrievalIfStale(newValue);
     }
     private void profileThemeChanged() {
-        setupProfileColors();
-
         Bundle bundle = new Bundle();
         onSaveInstanceState(bundle);
         // restart activity to reflect theme change