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

Commit 73a41324 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[SB][Chips] Update color tokens for accent-themed chips." into main

parents 8f7aa9a8 61e43a15
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
    }