Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Navigation drawer - disable swipe

Tags:

android

Is there any way to disable swipe gesture to open navigation drawer? Its really annoying when menu appears while swiping between tabs.

like image 333
keysersoze Avatar asked Jul 27 '13 19:07

keysersoze


1 Answers

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

like image 107
hardartcore Avatar answered Sep 22 '22 20:09

hardartcore