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

Commit 9cddf7c6 authored by Ioana Alexandru's avatar Ioana Alexandru Committed by Android (Google) Code Review
Browse files

Merge "Update overflow dot color when app icon flag is on" into main

parents 08d67736 02e7facf
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -35,12 +35,13 @@ object StatusBarIconViewBinder {
    //  view-model (which, at the time of this writing, does not yet exist).

    suspend fun bindColor(view: StatusBarIconView, color: Flow<Int>) {
        color.collectTracingEach("SBIV#bindColor") { color ->
            // Don't change the icon color if an app icon experiment is enabled.
            if (!android.app.Flags.notificationsUseAppIcon()) {
            color.collectTracingEach("SBIV#bindColor") { color ->
                view.staticDrawableColor = color
                view.setDecorColor(color)
            }
            // Continue changing the overflow dot color
            view.setDecorColor(color)
        }
    }

@@ -57,15 +58,16 @@ object StatusBarIconViewBinder {
        iconColors: Flow<NotificationIconColors>,
        contrastColorUtil: ContrastColorUtil,
    ) {
        iconColors.collectTracingEach("SBIV#bindIconColors") { colors ->
            // Don't change the icon color if an app icon experiment is enabled.
            if (!android.app.Flags.notificationsUseAppIcon()) {
            iconColors.collectTracingEach("SBIV#bindIconColors") { colors ->
                val isPreL = java.lang.Boolean.TRUE == view.getTag(R.id.icon_is_pre_L)
                val isColorized = !isPreL || NotificationUtils.isGrayscale(view, contrastColorUtil)
                view.staticDrawableColor =
                    if (isColorized) colors.staticDrawableColor(view.viewBounds) else NO_COLOR
                view.setDecorColor(colors.tint)
            }
            // Continue changing the overflow dot color
            view.setDecorColor(colors.tint)
        }
    }
}