Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

disable the swipe gesture that opens the navigation drawer in android

I've been following the navigation drawer guide by Google and I'd like to add it to an Activity with tabs and gestures.

I'd like to disable the gesture to open the navigation drawer, does anyone have any idea how to do this?

like image 271
user1627990 Avatar asked Oct 14 '22 20:10

user1627990


People also ask

How do I disable swipe gestures?

Tap the gear icon next to “Gesture Navigation.” Note: The corner swipe gesture for Google Assistant is only available if you use gesture navigation. You don't have to turn it off if you use three-button navigation. Simply toggle the switch off for “Swipe to Invoke Assistant.”

How do you turn off drawer swipe react native?

For the current React Navigation version 3.11. 1, you can easily do so by adding drawerLockMode when create the drawer navigator. Change 'locked-open' to 'locked-closed' if you want to prevent gestures from opening the drawer but allow click on outside of drawer to close the drawer.


1 Answers

You should use:

mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);

It worked for me, the swipe to open the drawer was disabled.

If it still won't work, check out the answer provided here.

like image 489
Tran Hieu Avatar answered Oct 17 '22 09:10

Tran Hieu