From: Damyan Ivanov Date: Sun, 22 Dec 2019 12:57:57 +0000 (+0200) Subject: AccountSummary: fix stuck refreshing indicator after swipe-refresh is followed by... X-Git-Tag: v0.12.0~117 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=cafa154ed6dc563ce3eed57cfa4d66803cc9dcf6;p=mobile-ledger.git AccountSummary: fix stuck refreshing indicator after swipe-refresh is followed by a slide to the transaction list caused by registering the observer of the background task indicator in the wrong place --- 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 8eef8fbe..cdb2e59a 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 @@ -46,9 +46,6 @@ public class AccountSummaryFragment extends MobileLedgerListFragment { super.onCreate(savedInstanceState); debug("flow", "AccountSummaryFragment.onCreate()"); setHasOptionsMenu(true); - - Data.backgroundTasksRunning.observe(this.getViewLifecycleOwner(), - this::onBackgroundTaskRunningChanged); } public void onAttach(@NotNull Context context) { super.onAttach(context); @@ -68,6 +65,9 @@ public class AccountSummaryFragment extends MobileLedgerListFragment { debug("flow", "AccountSummaryFragment.onActivityCreated()"); super.onActivityCreated(savedInstanceState); + Data.backgroundTasksRunning.observe(this.getViewLifecycleOwner(), + this::onBackgroundTaskRunningChanged); + modelAdapter = new AccountSummaryAdapter(); mActivity.mAccountSummaryFragment = this;