google / accompanist

A collection of extension libraries for Jetpack Compose
https://google.github.io/accompanist
Apache License 2.0
7.43k stars 598 forks source link

[ThemeAdapter Material] - MaterialTheme.typography not working #1469

Closed khanhnt3010 closed 1 year ago

khanhnt3010 commented 1 year ago

Description Define xml theme:

<style name="Theme.MyApp" parent="Theme.MaterialComponents.DayNight">
    <!-- Material 2 color attributes -->
    <item name="colorPrimary">@color/purple_500</item>
    <item name="colorSecondary">@color/green_200</item>

    <!-- Material 2 type attributes-->
    <item name="textAppearanceBody1">@style/TextAppearance.MyApp.Body1</item>
    <item name="textAppearanceBody2">@style/TextAppearance.MyApp.Body2</item>

    <!-- Material 2 shape attributes-->
    <item name="shapeAppearanceSmallComponent">@style/ShapeAppearance.MyApp.SmallComponent</item>
</style>

Body1:

 <style name="TextAppearance.MyApp.Body1" parent="TextAppearance.MaterialComponents.Body1">
        <item name="fontFamily">@font/makeitsans_bold</item>
 </style>

But when using the MdcTheme, the font family is not affected the text

 Text(
                    text = uiModel.email,
                    style = MaterialTheme.typography.body1,
                    maxLines = 1,
                    overflow = TextOverflow.Ellipsis
                )
alexvanyo commented 1 year ago

Thanks for the issue report! Can you confirm that you're using the accompanist-themeadapter-material library?

khanhnt3010 commented 1 year ago

Thanks for the issue report! Can you confirm that you're using the accompanist-themeadapter-material library?

Yes, I'm using "com.google.accompanist:accompanist-themeadapter-material:0.28.0" compose version 1.3.2

bentrengrove commented 1 year ago

I haven't been able to reproduce this sorry. Could you possibly please attach a sample project that demonstrates the issue?

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.