]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java
whitespace
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / account_summary / AccountSummaryFragment.java
index 5796b3365e64f0cfb79a95537ae66ae9209f7a62..cbdb191937455eeb8193ac55b62e6726795e1d1b 100644 (file)
@@ -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,16 +39,9 @@ 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 {
-
     public AccountSummaryAdapter modelAdapter;
     /*
         private MenuItem mShowOnlyStarred;
@@ -55,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);
@@ -94,10 +94,10 @@ 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");
-            mActivity.scheduleTransactionListRetrieval();
+            Data.scheduleTransactionListRetrieval(mActivity);
         });
 
         Data.accounts.addObserver(