I have the following question: I have several icons in my project, some white and some black.
Is it possible to change the color of the icon without having to import an icon already in the specific color? Ex: Leave 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.
TheideawouldbetodothisbutintheActionBaricons.IwouldliketoknowhowIcoulddothisandifitispossible?
Examples&suggestionsIfound:(Icouldnotgetittowork)
1
DrawablemDrawable=context.getResources().getDrawable(R.drawable.yourdrawable);mDrawable.setColorFilter(newPorterDuffColorFilter(0xffff00,PorterDuff.Mode.MULTIPLY));
2
ImageViewlineColorCode=(ImageView)convertView.findViewById(R.id.line_color_code);intcolor=Color.parseColor("#AE6118"); //The color u want
lineColorCode.setColorFilter(color);