Material (pre-compose) seems to have a well supported notion of custom typography - https://material.io/blog/android-material-theme-typeDoes this concept exist in compose Material (wear or mobile)? OR you should just follow the same approach with your own CompositionLocalProvider? Or generally people hardcode fonts inline and just use MaterialTheme for it's effect on Material widgets like Cards or Buttons?
I should have been clearer. I meant styles other than the named ones like "header1", "body2" etc. Are these possible like in xml themes. Say "score", "subtitles" etc.
10 months ago
Also yes, although it ends up looking a bit different than XMLIf its more than a one-off style (such as giving it a name), you can override the
at any point in your Compose hierarchy, and then all children within that will use the modified theme.So rather than having a large amount of slightly different MaterialThemes floating around where any of them could be used, there’s always a single
at any given point in the hierarchy.This also allows for some powerful things, like animated derivative theme’s like
OK, that's a good point. I guess it may be best to reuse the existing typeface labels, shapes and colors, and have different themes in different parts of the app. NewsfeedTheme, MarketplaceTheme, and so on. Thanks!