Skip to content

Commit b21d419

Browse files
committed
Disallow parent layout to intercept touches meant to be handled by CardContainerView
1 parent 5e65bd6 commit b21d419

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cardstackview/src/main/java/com/yuyakaido/android/cardstackview/internal/CardContainerView.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,14 @@ public boolean onTouchEvent(MotionEvent event) {
8484
switch (MotionEventCompat.getActionMasked(event)) {
8585
case MotionEvent.ACTION_DOWN:
8686
handleActionDown(event);
87+
getParent().getParent().requestDisallowInterceptTouchEvent(true);
8788
break;
8889
case MotionEvent.ACTION_UP:
8990
handleActionUp(event);
91+
getParent().getParent().requestDisallowInterceptTouchEvent(false);
92+
break;
93+
case MotionEvent.ACTION_CANCEL:
94+
getParent().getParent().requestDisallowInterceptTouchEvent(false);
9095
break;
9196
case MotionEvent.ACTION_MOVE:
9297
handleActionMove(event);

0 commit comments

Comments
 (0)