Skip to content

Commit 812aef1

Browse files
committed
Fix overwrite icon color.
1 parent e15f671 commit 812aef1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

compoundicontextview/src/main/java/com/github/aakira/compoundicontextview/CompoundIconTextView.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,10 @@ private Drawable resource2VectorDrawable(@DrawableRes final int resourceId, @Col
258258
// See if we need to 'fix' the drawableLeft
259259
fixDrawable(drawable);
260260
// Set color
261-
DrawableCompat.setTint(drawable, iconColor);
262-
DrawableCompat.setTintMode(drawable, PorterDuff.Mode.SRC_IN);
261+
if(iconColor != UNDEFINED_RESOURCE) {
262+
DrawableCompat.setTint(drawable, iconColor);
263+
DrawableCompat.setTintMode(drawable, PorterDuff.Mode.SRC_IN);
264+
}
263265
// Resize Bitmap
264266
return new BitmapDrawable(context.getResources(),
265267
Bitmap.createScaledBitmap(drawable2Bitmap(drawable, iconWidth, iconHeight), iconWidth, iconHeight, true));

0 commit comments

Comments
 (0)