0

I'm trying to change the color of the android.support.v7.widget.Toolbar (23.2.1 support library) arrow with api 16. The usual way of changing the back arrow color is like this:

final Drawable upArrow = ContextCompat.getDrawable(getContext(), R.drawable.abc_ic_ab_back_mtrl_am_alpha);  

upArrow.setColorFilter(ContextCompat.getColor(getContext(), R.color.somecolor), PorterDuff.Mode.SRC_ATOP);

getSupportActionBar().setHomeAsUpIndicator(upArrow);

However on api 16 the arrow stays the default white no matter what other I color I try to use. Is there another way of doing this for lower apis?

Edit - some stuff tried:

• changing the theme to .Light will make the arrows black, but doesn't help if I need a different color

• adding colorControlNormal in the theme will change the color, but if I want two different colored arrows in two different activities I have to support multiple themes.

• vectorDrawables.useSupportLibrary = true apparently needs to be added to the gradle

Jon
  • 7,941
  • 9
  • 53
  • 105

1 Answers1

0

try this it worked for me,

Put this in style:

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

Pradeep Gupta
  • 1,770
  • 1
  • 9
  • 23
  • This works for the navdrawer icon. However all the toolbars stay with white back arrows. – Jon Apr 06 '16 at 11:36