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

Commit 02e7facf authored by Ioana Alexandru's avatar Ioana Alexandru
Browse files

Update overflow dot color when app icon flag is on

Previously we weren't applying colors at all to any icons, including the
overflow dot (which should still be updated).

Bug: 335211019
Test: manually check that the dot color is correct
Flag: ACONFIG android.app.notifications_use_app_icon DEVELOPMENT
Change-Id: I2fb29d4734c7eab7026fbc68001a710b9a5a0827
parent 51749341
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)
        }
    }
}