Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Icon Of Navigation Drawer

I am having trouble with changing my navigation drawer icon to a custom one. I've currently had to implement the standard drawer icon which has 3 horizontal lines on top, but now I want to replace this with my custom drawer icon.

This is how my mDrawerToggle is at the moment:

mDrawerToggle=new ActionBarDrawerToggle(this,     mDrawerLayout,     R.drawable.app_icon,     R.string.drawer_open) {         // My code     }; 
like image 226
Tufan Avatar asked Apr 10 '15 09:04

Tufan


People also ask

How do I change the color of the drawer icon?

To change the drawer icon color in Flutter: Simply add the iconTheme property inside the AppBar widget and assign the IconThemeData(color: [your_color]).


1 Answers

Use below code,it's working for V7 ActionBarDrawerToggle

mDrawerToggle.setDrawerIndicatorEnabled(false);  mDrawerToggle.setHomeAsUpIndicator(R.drawable.your_custom_icon);  mDrawerToggle.setToolbarNavigationClickListener(new View.OnClickListener() { @Override  public void onClick(View v) {      if (mDrawerLayout.isDrawerVisible(GravityCompat.START)) {           mDrawerLayout.closeDrawer(GravityCompat.START);      } else {          mDrawerLayout.openDrawer(GravityCompat.START);     } } }); 
like image 151
Prashant Date Avatar answered Sep 30 '22 03:09

Prashant Date