shiburagi / Drawer-Behavior

Drawer behavior is a library that provide an extra behavior on drawer, such as, move view or scaling view's height while drawer on slide.
https://shiburagi.github.io/Drawer-Behavior/
MIT License
593 stars 101 forks source link

Is there any way to disable the swipe-to-open gesture? #5

Closed albert0m closed 5 years ago

albert0m commented 6 years ago

I want to open the drawer programmatically and not have the user swipe from left or right. Is there any way to do that? Thank you

shiburagi commented 6 years ago

To open drawer

drawer.openDrawer(Gravity.START); // Open left drawer

drawer.openDrawer(Gravity.END); // Open right drawer

To close drawer

drawer.closeDrawer(Gravity.START); // Close left drawer

drawer.closeDrawer(Gravity.END); // Close right drawer

To disable swipe gesture

drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_OPEN, leftDrawerView);
shiburagi commented 6 years ago

For more solution on disable swipe, you may refer on link below https://stackoverflow.com/questions/17025957/disable-gesture-listene

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.