]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/MobileLedgerListFragment.java
separate FAB management in a helper class
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / MobileLedgerListFragment.java
index 85593a2138b52b40831c5b716a1c3c92959debff..c5bbe0c4eece2f4325c353ac935bb15ffcad6fef 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2019 Damyan Ivanov.
+ * Copyright © 2021 Damyan Ivanov.
  * This file is part of MoLe.
  * MoLe is free software: you can distribute it and/or modify it
  * under the term of the GNU General Public License as published by
 
 package net.ktnx.mobileledger.ui;
 
+import androidx.annotation.NonNull;
 import androidx.fragment.app.Fragment;
-import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
 import androidx.recyclerview.widget.RecyclerView;
+import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
 
 import net.ktnx.mobileledger.ui.activity.MainActivity;
 import net.ktnx.mobileledger.ui.transaction_list.TransactionListAdapter;
+import net.ktnx.mobileledger.utils.Colors;
 
 public class MobileLedgerListFragment extends Fragment {
-    protected MainActivity mActivity;
-    public SwipeRefreshLayout swiper;
-    protected RecyclerView root;
+    public SwipeRefreshLayout refreshLayout;
     public TransactionListAdapter modelAdapter;
+    protected RecyclerView root;
+    @NonNull
+    public MainActivity getMainActivity() {
+        return (MainActivity) requireActivity();
+    }
+    protected void themeChanged(Integer counter) {
+        refreshLayout.setColorSchemeColors(Colors.getSwipeCircleColors());
+    }
+    public void onBackgroundTaskRunningChanged(Boolean isRunning) {
+        if (getActivity() == null)
+            return;
+        if (refreshLayout == null)
+            return;
+        refreshLayout.setRefreshing(isRunning);
+    }
 }