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?
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.”
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With