Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to open the drawer by dragging from the middle of the screen? #48

Open
OgabekYuldashov opened this issue Mar 17, 2018 · 4 comments
Open

Comments

@OgabekYuldashov
Copy link

OgabekYuldashov commented Mar 17, 2018

Is there a cleaner way to set an offset margin to the left screen edge so that I can open the drawer menu with a drag in the middle of the open fragment/screen? Because it is really difficult to reach the left edge if the device has a 6.3 inch screen.

@vikas-jain-plutus
Copy link

Can anyone please help me with this?
How to open the drawer by dragging from the middle of the screen?

@equetzal
Copy link

Can anyone please help me with this?
How to open the drawer by dragging from the middle of the screen?

You need to modify the library itself, so download the repo and then import the library on Android Studio (I parsed all the library to Kotlin to do it easy but you can use the Java one). Then on this file https://github.com/yarolegovich/SlidingRootNav/blob/master/library/src/main/java/com/yarolegovich/slidingrootnav/SlidingRootNavLayout.java, you need to change the line 263 from return child == rootView && isOnEdge; to return child == rootView, this is going to quit the restriction of only open if is being dragged from the edge.
Probably this should be configurable on the API, but this is how the made the library, so yes, you need to modify the library to do that.
Hope it helps you!

@gusio-ai
Copy link

gusio-ai commented Nov 28, 2020 via email

@equetzal
Copy link

equetzal commented Dec 1, 2020

You can put 'library' on gradle for the local libraries (there are a lot of tutorials on how to import a github library to you project on android studio), or you can copy-paste each class and change the package if you want to include it on the project itself (just remember to use the license).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants