Added two finger to close player gesture

This commit is contained in:
vkay94 2020-10-10 15:00:39 +02:00
parent 9e1bc631cf
commit f6925fc5b8

View file

@ -42,6 +42,17 @@ public class CustomBottomSheetBehavior extends BottomSheetBehavior<FrameLayout>
return false; 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.
if (event.getPointerCount() == 2) {
// Skip the collapsed state during pulling
setSkipCollapsed(true);
return super.onInterceptTouchEvent(parent, child, event);
} else {
setSkipCollapsed(false);
}
// Don't need to do anything if bottomSheet isn't expanded // Don't need to do anything if bottomSheet isn't expanded
if (getState() == BottomSheetBehavior.STATE_EXPANDED if (getState() == BottomSheetBehavior.STATE_EXPANDED
&& event.getAction() == MotionEvent.ACTION_DOWN) { && event.getAction() == MotionEvent.ACTION_DOWN) {