How can I disable single finger menu drawer open (swipe left to right) for the DrawerLayout, however allow the menu drawer to open with two fingers swipe?
Single finger swipe to not open the drawer menu, but child views to be able to process touch events. Only the menu open functionality is to be forbidden for single finger swipe.
An update: I have read this very useful topic: (Android: Difference between onInterceptTouchEvent and dispatchTouchEvent?) .
So I've decided to overrrite method onInterceptTouchEvent
public boolean onInterceptTouchEvent(MotionEvent arg) {
if (arg.getPointerCount() < 2 && !this.isDrawerOpen(this.listView)) {
return true;
} else {
return super.onInterceptTouchEvent(arg);
}
}
However obviously it does not send touch events to children views.
I think I have to use LOCK_MODE_LOCKED_CLOSED
in order to control enable/disable of drawer. I will post that solution here later.