Navigation drawer is a great UI pattern recommended by Google when you design your Android application. Introduced with Android Lollipop, the Toolbar widget is a flexible way to customize easily the action bar. In this tutorial, you’re going to learn how to implement a navigation drawer with a toolbar on Android.
1. Get Material Colors
First, you need to get material colors for your application. A website like http://www.materialpalette.com can be useful to create quickly your material colors file. Here, we choose green and light green as primary colors :
Now, we could include the Toolbar in each activity and have just one place to change its configuration.
5. Add the Navigation Drawer to the Activity
Navigation Drawer is a great UI pattern recommended by Google when you develop Android applications. It’s a great way to organise navigation inside an application. Implementation is easy and we need to use DrawerLayout widget to implement it.
The layout of our main Activity will be like that :