]> git.ktnx.net Git - mobile-ledger.git/commitdiff
ProfileThemedActivity: track current profile changes
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Mon, 28 Dec 2020 11:39:54 +0000 (13:39 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Mon, 28 Dec 2020 15:52:19 +0000 (15:52 +0000)
needed by the new transaction activity which uses the mProfile value
(and its getApiVersion()) when saving the transaction. The API version
could have been changed by the "possible API version mismatch" dialog,
which may be used to open the profile editor

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

index 81450c9a13bedc9b0fe6e9cf17d8800a7cf1702b..745e888a03f40b3fa5bdd319c1c160ed313793c0 100644 (file)
@@ -41,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() {