Skip to content

SwipeLayout: Allow childs to deny swipe gesture #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 29, 2014

Conversation

PeterCxy
Copy link
Contributor

When used with ScorllView(or horizontal) inside SwipeLayout, the swipe
gesture may conflict with the scroll action. If use requestDisallowInterceptTouchEvent, the scroll action will be back but the parent ListView's scroll action may be disallowed too.

This patch solved this problem by introducing a "SwipeDenier"
interface whose implementation should return if this swipe event should
be denied. When onInterceptTouchEvent is called, SwipeLayout will call
all SwipeDenier and if one of them returns true, the event will not be
intercepted and passed to child views.

Tested in app: https://github.com/PaperAirplane-Dev-Team/BlackLight
which requires HorizontalScrollView inside SwipeLayout

Signed-off-by: Peter Cai xqsx43cxy@126.com

When used with ScorllView(or horizontal) inside SwipeLayout, the swipe
gesture may conflict with the scroll action. If use requestDisallowInterceptTouchEvent, the scroll action will be back but the parent ListView's scroll action may be disallowed too.

This patch solved this problem by introducing a "SwipeDenier"
interface whose implementation should return if this swipe event should
be denied. When onInterceptTouchEvent is called, SwipeLayout will call
all SwipeDenier and if one of them returns true, the event will not be
intercepted and passed to child views.

Tested in app: https://github.com/PaperAirplane-Dev-Team/BlackLight
which requires HorizontalScrollView inside SwipeLayout

Signed-off-by: Peter Cai <xqsx43cxy@126.com>
daimajia added a commit that referenced this pull request Aug 29, 2014
SwipeLayout: Allow childs to deny swipe gesture
@daimajia daimajia merged commit b8457a5 into daimajia:master Aug 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants