2
I have the following question: I have several icones in my design, some white and others black.
Is it possible to change the color of the icon without importing an icon already in the specific color? Ex: Let it Red, Yellow, etc...
Example where it works, but not where I need it:
Bottomnavigation does this, where the icons are originally black and the color set is Colorprimarydark.
The idea would be to do that in the icones of Actionbar. I wonder how I could do that and if it’s possible?
Examples & suggestions I found: (I couldn’t make it work)
1
Drawable mDrawable = context.getResources().getDrawable(R.drawable.yourdrawable);
mDrawable.setColorFilter(new
PorterDuffColorFilter(0xffff00,PorterDuff.Mode.MULTIPLY));
2
ImageView lineColorCode = (ImageView)convertView.findViewById(R.id.line_color_code);
int color = Color.parseColor("#AE6118"); //The color u want
lineColorCode.setColorFilter(color);
Are you using Bottomnavigationview? It would be interesting to put in your question, because maybe you have more viable ways to solve the problem,.
– viana
Bottomnavigationview I mentioned as an example only. What I want to get right is in Actionbar, but I edited the question anyway. @acklay
– TiagoIB