You can use
mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
to lock your DrawerLayout
so it won't be able to open with gestures. And unlock it with:
mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
Here you can find more info about DrawerLayout
: Android API - DrawerLayout
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…