Mine was to set a property based on a setting:
LaunchedEffect(isDarkTheme) {
val darkBG = (darkBackgroundFlow(context).firstOrNull() ?: false) || isDarkTheme
elementsManager.defaultTextColor = if (darkBG) onDarkBackground else onLightBackground
}
Since I'm also changing the
defaultTextColor
later based on the last color selected by the user, rotating the screen resets it to the
onDarkBackground
or
onLightBackground
, which I didn't want. But, now that I think, passing
darkBG
to my view model (where I'm creating the
elementsManager
) would be a better option, right?