Navigation drawer - disable swipe

Android

Android Problem Overview


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

Android Solutions


Solution 1 - Android

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionkeysersozeView Question on Stackoverflow
Solution 1 - AndroidhardartcoreView Answer on Stackoverflow