Change the color of Navigation Drawer indicator icon
Asked Answered
R

5

54

I am using a toolbar in place of actionbar and i am also using a navigation drawer.My toolbar colour is black and i want my navigation drawer indicator colour to be white.So how to change the colour of the navigation drawer indicator or put a custom navigation indicator in v7.Can any one please help me?

Robeson answered 25/7, 2015 at 12:34 Comment(2)
Possible duplicate of Color of animated ActionBarDrawerToggle in ActionBarJaynejaynell
I have answered how to do it programmatically on another question(#27251415). Please mark this question as duplicate.Jaynejaynell
A
141

Try creating this style in your styles.xml.

<style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
    <item name="color">@android:color/white</item>
</style>

And, then add it to you AppTheme style like the following.

<item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
Antifriction answered 26/7, 2015 at 0:31 Comment(3)
It only changes hamburger icon color. Back arrow color remains unchanged.Lackadaisical
@Lackadaisical I want to change both. Can you help?Aplacental
@RishabhSrivastava Add app:popupTheme and app:theme to toolbar. And use <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Dark"> <item name="colorControlNormal">@android:color/white</item> </style> .Lackadaisical
D
23

In your AppTheme add this style.

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
</style>

<style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
<item name="spinBars">true</item>
<item name="color">@android:color/white</item>
</style>

Donnadonnamarie answered 17/2, 2016 at 11:24 Comment(0)
C
19

Put this code in your activity

toggle.getDrawerArrowDrawable().setColor(getResources().getColor(R.color.grey));
Contrabandist answered 12/9, 2018 at 19:38 Comment(0)
D
11

The following worked for me.

 <style name="ToolBarStyle" parent="Theme.AppCompat.Light.NoActionBar">
            <item name="colorControlNormal">@android:color/white</item>
        </style>
Digestion answered 17/3, 2016 at 9:39 Comment(1)
its is the best and shortest method to change color of navigation indicator , thanksHegel
N
2

1: Go to directory res -> themes.xml

2: Inside:

<style name="Theme.YourAppName" parent="Theme.MaterialComponents.Light.NoActionBar">

add this line: <item name="colorControlNormal">@android:color/white</item>

you can add this to themes.xml (night) or you may change it according to your preferred style.

Nievesniflheim answered 11/3, 2021 at 11:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.