From 8f0fb0f2a3db2a96af738592d711b0f205c80a06 Mon Sep 17 00:00:00 2001 From: kosyak Date: Thu, 22 Jun 2023 11:13:18 +0300 Subject: [PATCH] prevent vertical scrolling during swipe --- src/main/java/com/cheogram/android/SwipeDetector.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/cheogram/android/SwipeDetector.java b/src/main/java/com/cheogram/android/SwipeDetector.java index 81653cbe8..93c2405c8 100644 --- a/src/main/java/com/cheogram/android/SwipeDetector.java +++ b/src/main/java/com/cheogram/android/SwipeDetector.java @@ -50,7 +50,6 @@ public class SwipeDetector implements View.OnTouchListener { public boolean onTouch(View v, MotionEvent event) { if (touchSlop == -1) { touchSlop = ViewConfiguration.get(v.getContext()).getScaledTouchSlop(); - android.util.Log.e("25fd", touchSlop + " "); } switch (event.getAction()) { @@ -68,8 +67,8 @@ public class SwipeDetector implements View.OnTouchListener { float deltaY = downY - upY; if ( - (allowedActions.contains(Action.LR) && deltaX > touchSlop || - allowedActions.contains(Action.RL) && deltaX < -touchSlop) && Math.abs(deltaY) < touchSlop + (allowedActions.contains(Action.LR) && deltaX < -touchSlop || + allowedActions.contains(Action.RL) && deltaX > touchSlop) && Math.abs(deltaX) > Math.abs(deltaY) ) { v.getParent().requestDisallowInterceptTouchEvent(true); }