]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java
migrate themeWatch to LiveData
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / account_summary / AccountSummaryFragment.java
index 73a75af481414df38fd7607cb478bd0193ff7af8..94056ab80201c4412d7dea2d8f13677642b18771 100644 (file)
@@ -158,8 +158,7 @@ public class AccountSummaryFragment extends MobileLedgerListFragment {
             }
         });
         swiper = mActivity.findViewById(R.id.account_swiper);
-        Colors.themeWatch.addObserver((o, arg) -> swiper.setColorSchemeColors(Colors.primary));
-        swiper.setColorSchemeColors(Colors.primary);
+        Colors.themeWatch.observe(this, this::themeChanged);
         swiper.setOnRefreshListener(() -> {
             Log.d("ui", "refreshing accounts via swipe");
             mActivity.scheduleTransactionListRetrieval();
@@ -167,9 +166,6 @@ public class AccountSummaryFragment extends MobileLedgerListFragment {
 
         Data.accounts.addObserver(
                 (o, arg) -> mActivity.runOnUiThread(() -> modelAdapter.notifyDataSetChanged()));
-        Data.profile.addObserver((o, arg) -> mActivity.runOnUiThread(
-                AccountSummaryViewModel::scheduleAccountListReload));
-        update_account_table();
     }
     private void update_account_table() {
         if (this.getContext() == null) return;