From 6359c243873d0b541b5b98fc0cfbe8a10c3d21b7 Mon Sep 17 00:00:00 2001 From: JasonHezz Date: Thu, 26 Oct 2017 09:08:48 +0800 Subject: [PATCH] make drawable mutable --- .../src/main/java/com/xw/repo/VectorCompatTextView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vectorcompattextview/src/main/java/com/xw/repo/VectorCompatTextView.java b/vectorcompattextview/src/main/java/com/xw/repo/VectorCompatTextView.java index 2d0b0d4..37aa74c 100644 --- a/vectorcompattextview/src/main/java/com/xw/repo/VectorCompatTextView.java +++ b/vectorcompattextview/src/main/java/com/xw/repo/VectorCompatTextView.java @@ -117,9 +117,9 @@ private void initDrawables(Drawable... drawables) { private void tintDrawable(Drawable drawable) { if (drawable != null) { if (isTintDrawableInTextColor) { - DrawableCompat.setTint(drawable, getCurrentTextColor()); + DrawableCompat.setTint(drawable.mutate(), getCurrentTextColor()); } else if (mDrawableCompatColor != 0) { - DrawableCompat.setTint(drawable, mDrawableCompatColor); + DrawableCompat.setTint(drawable.mutate(), mDrawableCompatColor); } } }