Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix overwrite icon color #7

Merged
merged 4 commits into from
Nov 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ buildscript {
}

dependencies {
compile 'com.github.aakira:compound-icon-textview:1.1.0@aar'
compile 'com.github.aakira:compound-icon-textview:1.2.0@aar'
}
```
## Using libraries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,10 @@ private Drawable resource2VectorDrawable(@DrawableRes final int resourceId, @Col
// See if we need to 'fix' the drawableLeft
fixDrawable(drawable);
// Set color
DrawableCompat.setTint(drawable, iconColor);
DrawableCompat.setTintMode(drawable, PorterDuff.Mode.SRC_IN);
if(iconColor != UNDEFINED_RESOURCE) {
DrawableCompat.setTint(drawable, iconColor);
DrawableCompat.setTintMode(drawable, PorterDuff.Mode.SRC_IN);
}
// Resize Bitmap
return new BitmapDrawable(context.getResources(),
Bitmap.createScaledBitmap(drawable2Bitmap(drawable, iconWidth, iconHeight), iconWidth, iconHeight, true));
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ org.gradle.jvmargs=-Xmx1536m

# This library version

LIBRARY_VERSION_CODE=2
LIBRARY_VERSION_NAME=1.1.0
LIBRARY_VERSION_CODE=3
LIBRARY_VERSION_NAME=1.2.0

# App information

Expand Down