Created
April 25, 2016 06:09
-
-
Save shem8/0d59e089f5bce63028d1ba92c5767582 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SwipeDismissOnlyOnViewBehavior<V extends View> extends SwipeDismissBehavior<V> { | |
/** | |
* Handle only touches on this current view | |
*/ | |
@Override | |
public boolean onTouchEvent(CoordinatorLayout parent, V child, MotionEvent event) { | |
if (parent.isPointInChildBounds(child, (int) event.getX(), (int) event.getY())) { | |
return super.onTouchEvent(parent, child, event); | |
} | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment