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

Commit f647b94e authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[SB][Screen Chips] Update color token for screen chips.

Fixes: 353486206
Bug: 332662551
Flag: com.android.systemui.status_bar_screen_sharing_chips
Test: trigger screen chip in light mode -> verify color
Test: trigger screen chpi in dark mode -> verify color
Change-Id: Ie31dd00856c503b2f9b28c1cd271c9a071c53dcc
parent 4b095d86
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.systemui.statusbar.chips.ui.model

import android.content.Context
import android.content.res.ColorStateList
import android.view.ContextThemeWrapper
import androidx.annotation.ColorInt
import com.android.settingslib.Utils
import com.android.systemui.res.R
@@ -41,8 +42,11 @@ sealed interface ColorsModel {

    /** The chip should have a red background with white text. */
    data object Red : ColorsModel {
        override fun background(context: Context): ColorStateList =
            ColorStateList.valueOf(context.getColor(R.color.GM2_red_600))
        override fun background(context: Context): ColorStateList {
            val themedContext =
                ContextThemeWrapper(context, com.android.internal.R.style.Theme_DeviceDefault_Light)
            return Utils.getColorAttr(themedContext, com.android.internal.R.attr.materialColorError)
        }

        override fun text(context: Context) = context.getColor(android.R.color.white)
    }