]> git.ktnx.net Git - mobile-ledger-staging.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileThemedActivity.java
themes: secondary==primary, a bit closer primaryDark, no calculations
[mobile-ledger-staging.git] / app / src / main / java / net / ktnx / mobileledger / ui / activity / ProfileThemedActivity.java
index fb6db900d7031f0fefe82c40b4997d44ed533dbb..81450c9a13bedc9b0fe6e9cf17d8800a7cf1702b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2019 Damyan Ivanov.
+ * Copyright © 2020 Damyan Ivanov.
  * This file is part of MoLe.
  * MoLe is free software: you can distribute it and/or modify it
  * under the term of the GNU General Public License as published by
@@ -20,17 +20,18 @@ package net.ktnx.mobileledger.ui.activity;
 import android.annotation.SuppressLint;
 import android.os.Bundle;
 
+import androidx.annotation.Nullable;
+
 import net.ktnx.mobileledger.model.Data;
 import net.ktnx.mobileledger.model.MobileLedgerProfile;
 import net.ktnx.mobileledger.utils.Colors;
 
-import androidx.annotation.Nullable;
-
 @SuppressLint("Registered")
 public class ProfileThemedActivity extends CrashReportingActivity {
     protected MobileLedgerProfile mProfile;
     protected void setupProfileColors() {
-        Colors.setupTheme(this, mProfile);
+        final int themeHue = (mProfile == null) ? -1 : mProfile.getThemeHue();
+        Colors.setupTheme(this, themeHue);
     }
     @Override
     protected void onStart() {
@@ -39,10 +40,10 @@ public class ProfileThemedActivity extends CrashReportingActivity {
     }
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         initProfile();
-        super.onCreate(savedInstanceState);
         setupProfileColors();
+        super.onCreate(savedInstanceState);
     }
     protected void initProfile() {
-        mProfile = Data.profile.get();
+        mProfile = Data.initProfile();
     }
 }