How to change Material 3 Native Appbar title text size

17 views Asked by At

I have an app using the native Top App bar (that one that you dont have to define it in the layout).

My problem is that there is no way to change the font size (by default is too big for my taste).

So, my App uses Material 3. All my activities uses the custome defined theme: "@style/Theme.MyApplication", which is defined as:

<style name="Theme.MyApplication" parent="Theme.Material3.DayNight"></style>
    <item name="actionBarTheme">@style/ThemeOverlay.Actionbar</item>
    <item name="colorOnSurface">#FFF</item> <!-- Actionbar textcolor -->
    <item name="colorOnSurfaceVariant">#314962</item> <!-- ActionBar subtitle color -->
</style>
<style name="ThemeOverlay.Actionbar" parent="ThemeOverlay.Material3.Dark.ActionBar"> <!-- Native Appbar -->
    <item name="android:textColorPrimary">@color/colorAccent</item>
</style>

With this styles I am able to custom change colors, but I can't change the title textSize. I tried editing everywhere the next attributes:

  • titleTextAppearance
  • titleTextStyle
  • textAppearanceTitleLarge
  • textAppearanceTitleMedium

According to Material3 documentation (https://github.com/material-components/material-components-android/blob/master/docs/components/TopAppBar.md) it should be by overriding titleTextStyle, but it does not work.

Thanks,

0

There are 0 answers