]> 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 d75577ff3d8f94c26f82a2493a960242d9605a78..e6ba48fb05e5b7bb2a6e8e32bbe8a60c64adf1d2 100644 (file)
@@ -44,10 +44,10 @@ import static net.ktnx.mobileledger.utils.Logger.debug;
 public class AccountSummaryFragment extends MobileLedgerListFragment {
 
     public AccountSummaryAdapter modelAdapter;
-/*
-    private MenuItem mShowOnlyStarred;
-    private Menu optMenu;
-*/
+    /*
+        private MenuItem mShowOnlyStarred;
+        private Menu optMenu;
+    */
     private FloatingActionButton fab;
     @Override
     public void onCreate(@Nullable Bundle savedInstanceState) {
@@ -83,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);
@@ -124,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(() -> {