Material Drawer and Toolbar Options

Posted by in Software, Tutorial

The latest couple of days I’ve spent in adding the Excellent Material Drawer to one of my applications. In my case, the drawer is shown on the second activity in the workflow.

Below, I’ll outline my experiments.


First, the requirements are:

  1. An android application with one (or more activities) (d’oh!) and
  2. Material Drawer

Code for obtaining the actionBar (v7 appcompat):

No hamburger menu

The original code I had for the customisation was to hide the “back arrow” and show the logo and title:

The result is something like this:

Original layout

To keep the same layout, you only need to not add the toolbar to the drawer. Then, the drawer can be triggered only through sliding. The code would be:

Showing the hamburger menu

If you do add the withToolbar() into the drawer code:

then you get:

With hamburger menu

It does have the hamburger menu, it does let you click on it to get the drawer, but it’s quite crowded. So, my decision was to remove the icon and have it much simpler (the action bar customisation code):

with the resulting image:


With the proper color scheme (icon color as primary) it’s even better:

Color scheme


A little experiment: If you find this post and ad below useful, please check the ad out 🙂