]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/MobileLedgerListFragment.java
flag initial amount hint as present (still null)
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / MobileLedgerListFragment.java
index da1ea1e642bb54c7e2a59cf8f6da0d6937372dca..a61f44f6e2417eb2d54654827e8d731c20586ac6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2020 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
@@ -49,16 +49,15 @@ public class MobileLedgerListFragment extends Fragment {
     }
     protected void manageFabOnScroll() {
         final MainActivity mainActivity = getMainActivity();
-        int triggerPixels = DimensionUtils.dp2px(mainActivity, 30f);
+        int triggerPixels = DimensionUtils.dp2px(mainActivity, 10f);
         root.addOnItemTouchListener(new RecyclerView.OnItemTouchListener() {
             private float upAnchor = -1;
-            private float downAnchor = -1;
             private float lastY;
             @Override
             public boolean onInterceptTouchEvent(@NonNull RecyclerView rv, @NonNull MotionEvent e) {
                 switch (e.getActionMasked()) {
                     case MotionEvent.ACTION_DOWN:
-                        lastY = upAnchor = downAnchor = e.getAxisValue(MotionEvent.AXIS_Y);
+                        lastY = upAnchor = e.getAxisValue(MotionEvent.AXIS_Y);
                         break;
                     case MotionEvent.ACTION_MOVE:
                         final float currentY = e.getAxisValue(MotionEvent.AXIS_Y);
@@ -70,8 +69,6 @@ public class MobileLedgerListFragment extends Fragment {
                         }
                         else {
                             // swipe up
-                            downAnchor = lastY;
-
                             if (currentY < upAnchor - triggerPixels)
                                 mainActivity.fabHide();
                         }