Fixed #49 some drawables were not tinted with the right color

This commit is contained in:
Karim Abou Zeid 2015-08-15 00:25:42 +02:00
commit 17a49b1ed4

View file

@ -78,6 +78,9 @@ public class Util {
public static Drawable getTintedDrawable(@NonNull Context context, @DrawableRes int drawableResId, int color) {
Drawable drawable = ContextCompat.getDrawable(context, drawableResId);
if (drawable != null) {
// If we don't mutate the drawable, then all drawables with this id will have a color
// filter applied to it.
drawable.mutate();
drawable.setColorFilter(color, PorterDuff.Mode.SRC_IN);
}
return drawable;