]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java
drop dummy bottom-list entries and intercept draw up/down to hide/show the Add FAB
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / account_summary / AccountSummaryFragment.java
index 362dadb9658c1d8a841c9ba55bf2d6bc49f01083..86f66d8d895647921391cc6105dc0b7ec4b0e74f 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 MenuItem mShowOnlyStarred;
     private Menu optMenu;
+*/
     private FloatingActionButton fab;
     @Override
     public void onCreate(@Nullable Bundle savedInstanceState) {
@@ -128,15 +124,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 +137,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 +204,5 @@ public class AccountSummaryFragment extends MobileLedgerListFragment {
             return true;
         });
     }
+*/
 }