From f8cc0fa2adea3815a5d0cea36b3c41d8b6d37a76 Mon Sep 17 00:00:00 2001 From: Matt Pietal Date: Thu, 26 Mar 2020 08:48:50 -0400 Subject: [PATCH] Controls UI - Fix routine icons App icons may not respond well to tinting, as currently defined, and the spec calls for them to remain untouched. Make sure to limit the icon size. Bug: 152397193 Test: visual Change-Id: I36afecfc440fb82814c5bd00ca20e4d71ce40789 --- packages/SystemUI/res/layout/controls_base_item.xml | 4 ++-- packages/SystemUI/res/values/dimens.xml | 1 + .../com/android/systemui/controls/ui/ControlViewHolder.kt | 7 ++++++- .../src/com/android/systemui/controls/ui/RenderInfo.kt | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/res/layout/controls_base_item.xml b/packages/SystemUI/res/layout/controls_base_item.xml index 7708b8e9db6c8..6e1fd2072b328 100644 --- a/packages/SystemUI/res/layout/controls_base_item.xml +++ b/packages/SystemUI/res/layout/controls_base_item.xml @@ -30,8 +30,8 @@ 44dp 22sp 14sp + 24dp 4dp 1dp 12dp 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 9f5dd02b45148..7d3a860918696 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlViewHolder.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlViewHolder.kt @@ -21,6 +21,7 @@ import android.graphics.drawable.ClipDrawable import android.graphics.drawable.GradientDrawable import android.graphics.drawable.LayerDrawable import android.service.controls.Control +import android.service.controls.DeviceTypes import android.service.controls.actions.ControlAction import android.service.controls.templates.ControlTemplate import android.service.controls.templates.StatelessTemplate @@ -156,7 +157,11 @@ class ControlViewHolder( statusExtra.setTextColor(fg) icon.setImageDrawable(ri.icon) - icon.setImageTintList(fg) + + // do not color app icons + if (deviceType != DeviceTypes.TYPE_ROUTINE) { + icon.setImageTintList(fg) + } (clipLayer.getDrawable() as GradientDrawable).apply { setColor(context.getResources().getColor(bg, context.getTheme())) diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/RenderInfo.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/RenderInfo.kt index 27e46497b20aa..810ea65c78737 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/ui/RenderInfo.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/ui/RenderInfo.kt @@ -64,7 +64,7 @@ data class RenderInfo( val iconState = deviceIconMap.getValue(iconKey) val resourceId = iconState[enabled] - var icon: Drawable? = null + var icon: Drawable? if (resourceId == APP_ICON_ID) { icon = appIconMap.get(componentName) if (icon == null) {