From 9383f3f0f8211d036bee0cfcc0b64b514fcaaa58 Mon Sep 17 00:00:00 2001 From: andreibalmos Date: Wed, 18 May 2016 16:51:27 +0300 Subject: [PATCH] Stop parent intercepting touch event In case we use the CardStack in a ScrollView, or other parent that would would intercept the touch event and make an unnecessary action. By calling requestDisallowInterceptTouchEvent(true), the card stack will handle the touch events inside it on it's own, guaranteeing smooth animation. --- CardStack/src/main/java/com/wenchao/cardstack/CardStack.java | 1 + 1 file changed, 1 insertion(+) diff --git a/CardStack/src/main/java/com/wenchao/cardstack/CardStack.java b/CardStack/src/main/java/com/wenchao/cardstack/CardStack.java index 8cd1c6b..0ba9ff3 100644 --- a/CardStack/src/main/java/com/wenchao/cardstack/CardStack.java +++ b/CardStack/src/main/java/com/wenchao/cardstack/CardStack.java @@ -200,6 +200,7 @@ public boolean onTapUp() { private static final String DEBUG_TAG = "MotionEvents"; @Override public boolean onTouch(View arg0, MotionEvent event) { + CardStack.this.requestDisallowInterceptTouchEvent(true); dd.onTouchEvent(event); return true; }