From 664ab7b9eee7c7a81d8a7e30bd2584aa16779557 Mon Sep 17 00:00:00 2001 From: Hiroshi Kikuchi Date: Tue, 20 Aug 2019 15:43:29 +0900 Subject: [PATCH] Make stop intercepting parent ViewGroup touch event (such as ViewPager or ScrollView) --- .../java/com/mindorks/placeholderview/SwipePlaceHolderView.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/placeholderview/src/main/java/com/mindorks/placeholderview/SwipePlaceHolderView.java b/placeholderview/src/main/java/com/mindorks/placeholderview/SwipePlaceHolderView.java index 3df2b6f..7e95149 100644 --- a/placeholderview/src/main/java/com/mindorks/placeholderview/SwipePlaceHolderView.java +++ b/placeholderview/src/main/java/com/mindorks/placeholderview/SwipePlaceHolderView.java @@ -784,11 +784,13 @@ public boolean onInterceptTouchEvent(MotionEvent ev) { case MotionEvent.ACTION_DOWN: { mLastMotionY = (int) ev.getRawY(); mLastMotionX = (int) ev.getRawX(); + getParent().requestDisallowInterceptTouchEvent(true); break; } case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_UP: + getParent().requestDisallowInterceptTouchEvent(false); mIsBeingDragged = false; break; }