Closed viezel closed 9 years ago
The up button does not match in design when changing the color of title and subtitle.
Ricardo found this in a google search:
final Drawable upArrow = getResources().getDrawable(R.drawable.abc_ic_ab_back_mtrl_am_alpha); upArrow.setColorFilter(getResources().getColor(R.color.grey), PorterDuff.Mode.SRC_ATOP); getSupportActionBar().setHomeAsUpIndicator(upArrow);
I have used this piece of code in a project once for tinting the actionbar icons:
// Helper to tint the actionbar icons public static void tintMenuItem(String id, Menu menu){ MenuItem item = menu.findItem(RHelper.getId(id)); Drawable newIcon = (Drawable)item.getIcon(); newIcon.mutate().setColorFilter(NappApplication.getActionBarIconColor(), PorterDuff.Mode.SRC_IN); item.setIcon(newIcon); } public static void tintMenuItem(int id, Menu menu){ MenuItem item = menu.findItem(id); Drawable newIcon = (Drawable)item.getIcon(); newIcon.mutate().setColorFilter(NappApplication.getActionBarIconColor(), PorterDuff.Mode.SRC_IN); item.setIcon(newIcon); }
Hi @viezel sorry for the late reply. Thanks for your example code. I think this should work fine. I'll have a look now.
Thank you, Mads! It works as expected :+1:
The up button does not match in design when changing the color of title and subtitle.
Ricardo found this in a google search:
I have used this piece of code in a project once for tinting the actionbar icons: