Skip to content
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

Two finger to close player gesture #4476

Merged
merged 2 commits into from
Oct 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ public boolean onInterceptTouchEvent(@NonNull final CoordinatorLayout parent,
return false;
}

// The interception listens for the child view with the id "fragment_player_holder",
// so the following two-finger gesture will be triggered only for the player view on
// portrait and for the top controls (visible) on landscape.
setSkipCollapsed(event.getPointerCount() == 2);
if (event.getPointerCount() == 2) {
return super.onInterceptTouchEvent(parent, child, event);
}

// Don't need to do anything if bottomSheet isn't expanded
if (getState() == BottomSheetBehavior.STATE_EXPANDED
&& event.getAction() == MotionEvent.ACTION_DOWN) {
Expand Down