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
This commit is contained in:
Matt Pietal
2020-06-22 09:06:41 -04:00
parent ace942e57b
commit d0ab4bec4f

View File

@@ -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) {