From 698939027aa9cd4b1bc1486ff3e11636b6c160c3 Mon Sep 17 00:00:00 2001 From: Beth Thibodeau Date: Thu, 22 Dec 2022 13:09:59 -0600 Subject: Ignore output switcher chip for color transitions The output switcher chip intentionally changes colors when toggling dark mode. Since that element uses the same accent colors as other elements, we can ignore changes for it when deciding whether to animate to a new palette Fixes: 261695345 Test: manual - toggle dark mode, observe chip color changes without any other flickering Change-Id: I960d4f64f86fced604b18b86ff0aba5724af4abc --- .../android/systemui/media/controls/ui/ColorSchemeTransition.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/ColorSchemeTransition.kt b/packages/SystemUI/src/com/android/systemui/media/controls/ui/ColorSchemeTransition.kt index 5c65c8bd5689..4827a16d229d 100644 --- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/ColorSchemeTransition.kt +++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/ColorSchemeTransition.kt @@ -230,7 +230,14 @@ internal constructor( fun updateColorScheme(colorScheme: ColorScheme?): Boolean { var anyChanged = false - colorTransitions.forEach { anyChanged = it.updateColorScheme(colorScheme) || anyChanged } + colorTransitions.forEach { + val isChanged = it.updateColorScheme(colorScheme) + + // Ignore changes to colorSeamless, since that is expected when toggling dark mode + if (it == colorSeamless) return@forEach + + anyChanged = isChanged || anyChanged + } colorScheme?.let { mediaViewHolder.gutsViewHolder.colorScheme = colorScheme } return anyChanged } -- cgit v1.2.3-59-g8ed1b