I'm working on application that has a tab structure, and use sliding movements to move through the tabs.
But now, I want to apply Drawer Layout. The problem is that the Drawer has slide to open events. How I can delete this event? My idea was that the Drawer only could open and close with a button. Is this possible? Thanks!
By default the DrawerLayout is initially hidden from the view unless you put a code to open the
Drawer
, by the time there is a sliding event triggered.From the Navigation Drawer example, the contain
content_frame
is used to dynamically display views inside theDrawer
using fragments.From the
Fragment
'sonCreateView()
you can include a button somewhere that hasOnClickListener
where in you put this code,You Can also use* to close the drawer.
Just write
to prevent menu from listening to gesture
and use
openDrawer
andcloseDrawer
to change menu visibilityyou can write this way
If you want to navigate between drawer item on click of button inside your fragments, you can use this