Oussama Haff.
02/04/2021, 6:00 PMColors
and Typography
are annotated with different annotations @Stable
for the first and @Immutable
for the second.
Does this mean at a higher level that The Material Theme Composable expect colors to change at a moment of time (dark/light) but not expecting a change of typography ?fmasa
02/04/2021, 6:17 PMtypography state in:#compose
) 🙂Oussama Haff.
02/04/2021, 6:28 PMfmasa
02/04/2021, 6:32 PMLouis Pullen-Freilich [G]
02/04/2021, 7:21 PMCool thanks 👍 This means when writing a custom non material theme, if typography is a subject to change (like font customization by the app user) we will need to align with the colors declaration with state backed properties and strict comparaison.The other thing to note is that colors will often change individually. For example, if you have some album art and you want to change the
primary
color to match the album - you are changing one color, not all of them.
If a user is changing the font in the application, it is likely that all the text styles will need to change, so at that point there might not be much benefit from having the properties being state backed, and you can just change the value provided to the CompositionLocal
insteadOussama Haff.
02/05/2021, 2:08 PM