From d0ab4bec4ff3d51a447cac609c1700ed8dfa1eb8 Mon Sep 17 00:00:00 2001 From: Matt Pietal Date: Mon, 22 Jun 2020 09:06:41 -0400 Subject: [PATCH] Controls UI - Fix icon tint for custom icons ImageView has state that cannot be reversed regarding tintList, even if you set it to null. Therefore only clear the tint if we absolutely need to in order to avoid an override. Bug: 159559045 Test: manual Change-Id: Id2223136a76f7e7e3118d95f1ad126f768199d3f --- .../src/com/android/systemui/controls/ui/ControlViewHolder.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlViewHolder.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlViewHolder.kt index 865a38a2076c3..0e4f68431c160 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlViewHolder.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlViewHolder.kt @@ -413,7 +413,9 @@ class ControlViewHolder( control?.getCustomIcon()?.let { // do not tint custom icons, assume the intended icon color is correct - icon.imageTintList = null + if (icon.imageTintList != null) { + icon.imageTintList = null + } icon.setImageIcon(it) } ?: run { if (drawable is StateListDrawable) {