1

I want to change the ripple color of the DrawerToggle, but I couldn't find any way to do so. My style file looks like this. This changes the other menu items backgrounds but doesn't work for the back arrow. How do I change the ripple color of the Drawer Arrow

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">#FF0000</item>
    <item name="colorPrimaryDark">#660000</item>
    <item name="android:textColorPrimary">#FFFFFF</item>
    <item name="android:textColorSecondary">@android:color/white</item>
    <item name="android:actionMenuTextColor">@android:color/white</item>
    <item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
    <item name="android:actionBarItemBackground">@drawable/my_ripple_borderless</item>
    <item name="selectableItemBackground">@drawable/my_ripple</item>
    <item name="android:selectableItemBackground">@drawable/my_ripple</item>
    <item name="listChoiceBackgroundIndicator">@drawable/my_ripple</item>
    <item name="android:listChoiceBackgroundIndicator">@drawable/my_ripple</item>
</style>


<style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
    <!--<item name="spinBars">false</item>-->
    <item name="color">@color/drawer_icon_color</item>
</style>
osrl
  • 8,168
  • 8
  • 36
  • 57
  • This might help you changing ripple color https://developer.android.com/reference/android/graphics/drawable/RippleDrawable.html – Apurva Mar 17 '15 at 15:13
  • I already know this, I set a ripple drawable to `android:actionBarItemBackground `. I don't know what attribute I should set for arrow. – osrl Mar 17 '15 at 15:31

1 Answers1

4

Add this style

<style name="AppTheme.Toolbar">
    <item name="colorControlHighlight">@color/colorControlHighlight</item>
</style>

to your toolbar

<android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:theme="@style/AppTheme.Toolbar"
        app:popupTheme="@style/AppTheme.PopupOverlay" />

Original answer: https://stackoverflow.com/a/30676995/2311651

Community
  • 1
  • 1
Pavlo28
  • 1,454
  • 2
  • 16
  • 30