X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fui%2Factivity%2FProfileThemedActivity.java;h=745e888a03f40b3fa5bdd319c1c160ed313793c0;hb=c392329991fffc8aee0a7e888f68784976e473de;hp=d33608a6ea63e8be6c31c861976dbc2efb3c072b;hpb=0ce370cea3c5c980b6eeb14acf965188ae951f51;p=mobile-ledger-staging.git 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 d33608a6..745e888a 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 @@ -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 @@ -30,7 +30,8 @@ import net.ktnx.mobileledger.utils.Colors; 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() { @@ -40,6 +41,11 @@ public class ProfileThemedActivity extends CrashReportingActivity { protected void onCreate(@Nullable Bundle savedInstanceState) { initProfile(); setupProfileColors(); + Data.observeProfile(this, profile -> { + mProfile = profile; + setupProfileColors(); + }); + super.onCreate(savedInstanceState); } protected void initProfile() {