Skip to content

Commit 041fa58

Browse files
authored
Merge pull request #7 from AAkira/fix/overwrite-icon-color
Fix overwrite icon color
2 parents 05d5c4a + 81fa20e commit 041fa58

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ buildscript {
9999
}
100100
101101
dependencies {
102-
compile 'com.github.aakira:compound-icon-textview:1.1.0@aar'
102+
compile 'com.github.aakira:compound-icon-textview:1.2.0@aar'
103103
}
104104
```
105105
## Using libraries

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));

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ org.gradle.jvmargs=-Xmx1536m
1919

2020
# This library version
2121

22-
LIBRARY_VERSION_CODE=2
23-
LIBRARY_VERSION_NAME=1.1.0
22+
LIBRARY_VERSION_CODE=3
23+
LIBRARY_VERSION_NAME=1.2.0
2424

2525
# App information
2626

0 commit comments

Comments
 (0)