mutate() BitmapDrawable before directly editing
ExpandingEntryCardView directly modifies BitmapDrawables instead
of calling ImageView#setTint(). This was convenient, but had
the side affect of preventing re-use of these BitmapDrawables
with different tints.
Now that we want to share the same BitmapDrawables inside the
edit screen, we need to call mutate() on these drawables before
editing them in order to avoid affecting the tint in the edit
screen. Alternatively, we could change ExpandingEntryCardView
to use ImageView#setTint() instead. But this is more work.
Bug: 18004959
Change-Id: I5c0e33348cf538a69a10802a6205ad36fc548d54
diff --git a/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java b/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java
index dc8970b..af50d6b 100644
--- a/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java
+++ b/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java
@@ -559,15 +559,18 @@
if (entry.shouldApplyColor()) {
Drawable icon = entry.getIcon();
if (icon != null) {
+ icon.mutate();
icon.setColorFilter(mThemeColorFilter);
}
}
Drawable alternateIcon = entry.getAlternateIcon();
if (alternateIcon != null) {
+ alternateIcon.mutate();
alternateIcon.setColorFilter(mThemeColorFilter);
}
Drawable thirdIcon = entry.getThirdIcon();
if (thirdIcon != null) {
+ thirdIcon.mutate();
thirdIcon.setColorFilter(mThemeColorFilter);
}
}