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
This commit is contained in:
Beth Thibodeau
2022-12-22 13:09:59 -06:00
parent bdb5065a41
commit 698939027a

View File

@@ -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
}