Jan Skrasek
08/29/2020, 8:21 PMAdam Powell
08/29/2020, 8:23 PMJan Skrasek
08/29/2020, 8:32 PMLouis Pullen-Freilich [G]
08/29/2020, 8:33 PMprimary
color of the app depending on the podcast artwork, for a real-life example
https://github.com/android/compose-samples/tree/master/JetcasterJan Skrasek
08/29/2020, 8:51 PMLouis Pullen-Freilich [G]
08/29/2020, 9:15 PMMaterialTheme
internally modifies the state, it's a performance optimization for the internals, but isn't consumer facing
https://cs.android.com/androidx/platform/frameworks/support/+/androidx-master-dev:compose/material/material/src/commonMain/kotlin/androidx/compose/material/MaterialTheme.kt;l=63
Internally we just update the initial theme provided, with colors from the new object, instead of replacing the object in the ambient valueJan Skrasek
08/29/2020, 9:16 PMval rememberedColors = remember {
// TODO: b/162450508 remove the unnecessary .copy() here when it isn't needed to ensure that
// we don't skip the updateColorsFrom call
colors.copy()
}.apply { updateColorsFrom(colors) }