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

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

[Chipbar] Correctly bind icon color for chipbar.

I0305e6d8a879a9fc98295f2a9de43517a3a9992e changed the chipbar icon tint
to be a @ColorRes instead of @AttrRes, but we forgot that we also need
to change the calling code to use it as a color instead of an attr.
(There should probably be screenshot tests for the chipbar, but that's a
separate task.)

Fixes: 384970442
Flag: EXEMPT bugfix
Test: Trigger watch unlock chipbar -> verify icon is tinted correctly
Test: Trigger media TTT chipbar -> verify app icon isn't tinted
Change-Id: I960849a9351c18e57a39bcb7b2f5e4c0bcc6f338
parent 1837c2e9
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.systemui.common.ui.binder

import android.widget.ImageView
import com.android.settingslib.Utils
import com.android.systemui.common.shared.model.TintedIcon

object TintedIconViewBinder {
@@ -27,14 +26,11 @@ object TintedIconViewBinder {
     * [TintedIcon.tint] will always be applied, meaning that if it is null, then the tint *will* be
     * reset to null.
     */
    fun bind(
        tintedIcon: TintedIcon,
        view: ImageView,
    ) {
    fun bind(tintedIcon: TintedIcon, view: ImageView) {
        IconViewBinder.bind(tintedIcon.icon, view)
        view.imageTintList =
            if (tintedIcon.tint != null) {
                Utils.getColorAttr(view.context, tintedIcon.tint)
                view.context.getColorStateList(tintedIcon.tint)
            } else {
                null
            }