X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fui%2Faccount_summary%2FAccountSummaryFragment.java;h=cbdb191937455eeb8193ac55b62e6726795e1d1b;hb=51c50c59207fb6280e57e2e2ae210d52c3887ec4;hp=bb484929d9f221236bde6b05209cc5b07f5c25d4;hpb=6ab7b1bb9b7b5ffbbcc21db1d1e467e3d9752b6e;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 bb484929..cbdb1919 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 @@ -23,6 +23,12 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + import com.google.android.material.floatingactionbutton.FloatingActionButton; import net.ktnx.mobileledger.R; @@ -33,12 +39,6 @@ import net.ktnx.mobileledger.utils.Colors; import org.jetbrains.annotations.NotNull; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.recyclerview.widget.DividerItemDecoration; -import androidx.recyclerview.widget.LinearLayoutManager; -import androidx.recyclerview.widget.RecyclerView; - import static net.ktnx.mobileledger.utils.Logger.debug; public class AccountSummaryFragment extends MobileLedgerListFragment { @@ -54,7 +54,8 @@ public class AccountSummaryFragment extends MobileLedgerListFragment { debug("flow", "AccountSummaryFragment.onCreate()"); setHasOptionsMenu(true); - Data.backgroundTasksRunning.observe(this, this::onBackgroundTaskRunningChanged); + Data.backgroundTasksRunning.observe(this.getViewLifecycleOwner(), + this::onBackgroundTaskRunningChanged); } public void onAttach(@NotNull Context context) { super.onAttach(context); @@ -93,7 +94,7 @@ public class AccountSummaryFragment extends MobileLedgerListFragment { manageFabOnScroll(); swiper = mActivity.findViewById(R.id.account_swiper); - Colors.themeWatch.observe(this, this::themeChanged); + Colors.themeWatch.observe(getViewLifecycleOwner(), this::themeChanged); swiper.setOnRefreshListener(() -> { debug("ui", "refreshing accounts via swipe"); Data.scheduleTransactionListRetrieval(mActivity);