]> git.ktnx.net Git - mobile-ledger-staging.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java
rework transaction retrieval without MainActivity reference
[mobile-ledger-staging.git] / app / src / main / java / net / ktnx / mobileledger / ui / account_summary / AccountSummaryFragment.java
index fdeb54804e26471bbb2117c1736c29f7b7018fd7..63c7455df543f5ed45c9aae7d22e50da5d56ef3f 100644 (file)
@@ -93,18 +93,17 @@ public class AccountSummaryFragment extends MobileLedgerListFragment {
         Colors.themeWatch.observe(getViewLifecycleOwner(), this::themeChanged);
         refreshLayout.setOnRefreshListener(() -> {
             debug("ui", "refreshing accounts via swipe");
-            Data.scheduleTransactionListRetrieval(mainActivity);
+            Data.scheduleTransactionListRetrieval();
         });
 
         MobileLedgerProfile profile = Data.getProfile();
         profile.getDisplayedAccounts()
-               .observe(getViewLifecycleOwner(),
-                       (accounts) -> onAccountsChanged(profile, accounts));
+               .observe(getViewLifecycleOwner(), this::onAccountsChanged);
     }
-    private void onAccountsChanged(MobileLedgerProfile profile, List<LedgerAccount> accounts) {
+    private void onAccountsChanged(List<LedgerAccount> accounts) {
         Logger.debug("async-acc",
                 String.format(Locale.US, "fragment: got new account list (%d items)",
                         accounts.size()));
-        modelAdapter.setAccounts(profile, accounts);
+        modelAdapter.setAccounts(accounts);
     }
 }