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

Commit 61e43a15 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[SB][Chips] Update color tokens for accent-themed chips.

This update uses a slightly different accent color and also uses a color
that will stay the same between light & dark mode.

Bug: 394610705
Flag: EXEMPT refactor
Test: trigger phone call chip -> verify new color (see screenshots
inbug). Test with ChipsModernization both on & off, and
StatusBarNotifChips both on & off

Change-Id: Ic009aedcdfa259091a35cc1317303d97114989f6
parent 1dc545ca
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.systemui.statusbar.chips.ui.model
import android.content.Context
import android.content.res.ColorStateList
import androidx.annotation.ColorInt
import com.android.settingslib.Utils
import com.android.systemui.res.R

/** Model representing how the chip in the status bar should be colored. */
@@ -34,14 +33,14 @@ sealed interface ColorsModel {
    @ColorInt fun outline(context: Context): Int?

    /** The chip should match the theme's primary accent color. */
    // TODO(b/347717946): The chip's color isn't getting updated when the user switches theme, it
    // only gets updated when a different configuration change happens, like a rotation.
    data object AccentThemed : ColorsModel {
        override fun background(context: Context): ColorStateList =
            Utils.getColorAttr(context, com.android.internal.R.attr.colorAccent)
            ColorStateList.valueOf(
                context.getColor(com.android.internal.R.color.materialColorPrimaryFixedDim)
            )

        override fun text(context: Context) =
            Utils.getColorAttrDefaultColor(context, com.android.internal.R.attr.colorPrimary)
            context.getColor(com.android.internal.R.color.materialColorOnPrimaryFixed)

        override fun outline(context: Context) = null
    }