X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fui%2Faccount_summary%2FAccountSummaryFragment.java;h=fdeb54804e26471bbb2117c1736c29f7b7018fd7;hb=4f8b4f8bf16aaef182e1aac31a34f88a2adf5fa8;hp=dbc200eb8f6e8ff592ae02048c9682efd8326877;hpb=0a73337c99e2074aa7e7228204289896342ec636;p=mobile-ledger.git diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java index dbc200eb..fdeb5480 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java @@ -89,19 +89,17 @@ public class AccountSummaryFragment extends MobileLedgerListFragment { manageFabOnScroll(); - swiper = mainActivity.findViewById(R.id.account_swiper); + refreshLayout = mainActivity.findViewById(R.id.account_swipe_refresh_layout); Colors.themeWatch.observe(getViewLifecycleOwner(), this::themeChanged); - swiper.setOnRefreshListener(() -> { + refreshLayout.setOnRefreshListener(() -> { debug("ui", "refreshing accounts via swipe"); Data.scheduleTransactionListRetrieval(mainActivity); }); - MobileLedgerProfile profile = Data.profile.getValue(); - if (profile != null) { - profile.getDisplayedAccounts() - .observe(getViewLifecycleOwner(), - (accounts) -> onAccountsChanged(profile, accounts)); - } + MobileLedgerProfile profile = Data.getProfile(); + profile.getDisplayedAccounts() + .observe(getViewLifecycleOwner(), + (accounts) -> onAccountsChanged(profile, accounts)); } private void onAccountsChanged(MobileLedgerProfile profile, List accounts) { Logger.debug("async-acc",