material-components / material-components-android-compose-theme-adapter

A library that enables reuse of Material themes defined in XML for theming in Jetpack Compose.
https://material-components.github.io/material-components-android-compose-theme-adapter/
Apache License 2.0
415 stars 40 forks source link

Parse fontFamily in main theme as defaultFontFamily #73

Closed ricknout closed 3 years ago

ricknout commented 3 years ago

Some folks have reported using MDC themes but are specifying fontFamily/android:fontFamily as a top-level theme attribute as opposed to within individual TextAppearance styles. It would be useful to parse this and use it as the defaultFontFamily constructor parameter for Typography.

AppCompat Compose Theme Adapter does this so we can adapt the implementation: https://github.com/google/accompanist/blob/main/appcompat-theme/src/main/java/com/google/accompanist/appcompattheme/AppCompatTheme.kt#L220