I found previous discussions here about replicatin...
# compose-android
a
I found previous discussions here about replicating “Theme Overlays” but still unsure. If you have just a few effected screens, and some (not all) of the M3 widgets (of various kinds) must take on different container colors, etc, what is the best way to handle that?
One way would be wrapping all the different Composables (
MyButton =Button(colors = Default.colors(xxx=yyy
). Should I use
CompositionLocal
and try to override the colorScheme for that subtree?
k
What kind of color difference are we talking about? You can apply
MaterialTheme
with the full custom color scheme on any subtree
a
I need to give a few “FilledTonal” variants of buttons (Regular, Icon, etc) a translucent container color (so just one thing in the theme changes). M3 apply “secondary container” as container color for these components.
k
You can get the current color scheme from
MaterialTheme
, do a
copy
on it to change the specific color token, and then wrap your subtree with a new theme composable that is using that modified color scheme.
👍 1
a
Thank you