X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fui%2FMobileLedgerListFragment.java;h=a61f44f6e2417eb2d54654827e8d731c20586ac6;hb=9766797c69590d4c44374806eedcd530072ca9b3;hp=da1ea1e642bb54c7e2a59cf8f6da0d6937372dca;hpb=4f8b4f8bf16aaef182e1aac31a34f88a2adf5fa8;p=mobile-ledger.git diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/MobileLedgerListFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/MobileLedgerListFragment.java index da1ea1e6..a61f44f6 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/MobileLedgerListFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/MobileLedgerListFragment.java @@ -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(); }