In the last article you saw how to use DrawerLayout to create NavigationDrawer. Once you have a NavigationDrawer you may want to handle the drawer open and close events.
Like if the DrawerLayout is open you may like to display a different title and also hide some menu items.
In order to handle such events you need to create a ActionBarDrawerToggle object and assign it as a Drawer Listener.
Follow the video and refer to the Source code here
The navigation drawer is a panel that displays the app’s main navigation options on the left edge of the screen. It is hidden most of the time, but is revealed when the user swipes a finger from the left edge of the screen or, while at the top level of the app, the user touches the app icon in the action bar.
Say you have an e-commerce app. You can use the Navigation Drawer to display Categories and Sub Categories. Similarly for any app you can provide a set of shortcuts to the user.
How to add Navigation Drawer?
In order to add this you need to modify the layout xml file. To the layout xml file you need to add a Drawer Layout. You will need to add v4 support library, if you don’t have it.