Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f8cc0fa2 authored by Matt Pietal's avatar Matt Pietal
Browse files

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
parent 5e8e9e5f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -30,8 +30,8 @@

    <ImageView
        android:id="@+id/icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_width="@dimen/control_icon_size"
        android:layout_height="@dimen/control_icon_size"
        android:paddingTop="@dimen/control_padding_adjustment"
        android:clickable="false"
        android:focusable="false"
+1 −0
Original line number Diff line number Diff line
@@ -1225,6 +1225,7 @@
    <dimen name="controls_top_margin">44dp</dimen>
    <dimen name="control_header_text_size">22sp</dimen>
    <dimen name="control_text_size">14sp</dimen>
    <dimen name="control_icon_size">24dp</dimen>
    <dimen name="control_spacing">4dp</dimen>
    <dimen name="control_list_divider">1dp</dimen>
    <dimen name="control_corner_radius">12dp</dimen>
+6 −1
Original line number Diff line number Diff line
@@ -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)

        // 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()))
+1 −1
Original line number Diff line number Diff line
@@ -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) {