It's complicated. When the drawer is open, it captures your touch events, which cause the drawer to close. To avoid this, you need to subclass DrawerLayout and override the onInterceptTouchEvent method:
public class CustomDrawerLayout extends DrawerLayout { private View rightView; private int mTouchSlop; public CustomDrawerLayout (Context context) { this(context, null); } public CustomDrawerLayout (Context context, AttributeSet attrs) { this(context, attrs, 0); } public CustomDrawerLayout (Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(ViewConfiguration.get(context)); } public void setRightView (View v) { this.rightView = v; } @Override public boolean onInterceptTouchEvent (MotionEvent ev) { boolean result = super.onInterceptTouchEvent(ev); if (rightView != null && isDrawerOpen(rightView)) { DrawerLayout.LayoutParams layoutParams = (DrawerLayout.LayoutParams) rightView.getLayoutParams(); if (layoutParams.gravity == Gravity.END) {
This is my code working with the correct box. I am sure you can adapt this for your left drawer. You can also turn off the shadow:
mDrawerLayout.setScrimColor(Color.TRANSPARENT);
source share