]> 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 362dadb9658c1d8a841c9ba55bf2d6bc49f01083..e6ba48fb05e5b7bb2a6e8e32bbe8a60c64adf1d2 100644 (file)
 package net.ktnx.mobileledger.ui.account_summary;
 
 import android.content.Context;
-import android.content.SharedPreferences;
 import android.os.Bundle;
-import android.preference.PreferenceManager;
 import android.view.LayoutInflater;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
 
@@ -44,14 +39,15 @@ import androidx.recyclerview.widget.DividerItemDecoration;
 import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
 
-import static net.ktnx.mobileledger.ui.activity.SettingsActivity.PREF_KEY_SHOW_ONLY_STARRED_ACCOUNTS;
 import static net.ktnx.mobileledger.utils.Logger.debug;
 
 public class AccountSummaryFragment extends MobileLedgerListFragment {
 
-    private MenuItem mShowOnlyStarred;
     public AccountSummaryAdapter modelAdapter;
-    private Menu optMenu;
+    /*
+        private MenuItem mShowOnlyStarred;
+        private Menu optMenu;
+    */
     private FloatingActionButton fab;
     @Override
     public void onCreate(@Nullable Bundle savedInstanceState) {
@@ -87,7 +83,8 @@ public class AccountSummaryFragment extends MobileLedgerListFragment {
         llm.setOrientation(RecyclerView.VERTICAL);
         root.setLayoutManager(llm);
         root.setAdapter(modelAdapter);
-        DividerItemDecoration did = new DividerItemDecoration(mActivity, DividerItemDecoration.VERTICAL);
+        DividerItemDecoration did =
+                new DividerItemDecoration(mActivity, DividerItemDecoration.VERTICAL);
         root.addItemDecoration(did);
 
         fab = mActivity.findViewById(R.id.btn_add_transaction);
@@ -128,15 +125,9 @@ public class AccountSummaryFragment extends MobileLedgerListFragment {
 //                }));
 
         mActivity.fabShouldShow();
-        root.addOnScrollListener(new RecyclerView.OnScrollListener() {
-            @Override
-            public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
-                if (fab != null) {
-                    if (dy < 0) mActivity.fabShouldShow();
-                    if (dy > 0) fab.hide();
-                }
-            }
-        });
+
+        manageFabOnScroll();
+
         swiper = mActivity.findViewById(R.id.account_swiper);
         Colors.themeWatch.observe(this, this::themeChanged);
         swiper.setOnRefreshListener(() -> {
@@ -147,11 +138,7 @@ public class AccountSummaryFragment extends MobileLedgerListFragment {
         Data.accounts.addObserver(
                 (o, arg) -> mActivity.runOnUiThread(() -> modelAdapter.notifyDataSetChanged()));
     }
-    private void update_account_table() {
-        if (this.getContext() == null) return;
-
-        AccountSummaryViewModel.scheduleAccountListReload();
-    }
+/*
     void stopSelection() {
         modelAdapter.stopSelection();
         if (optMenu != null) {
@@ -218,4 +205,5 @@ public class AccountSummaryFragment extends MobileLedgerListFragment {
             return true;
         });
     }
+*/
 }