0

I have defined a font type for my Android application. This works correctly except in the preferences dialogs that appear with the system's default font. I have defined a theme for the Alert Dialog but the font does not apply either.

    <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="android:fontFamily">@font/pacifico</item>
    <!-- This will override the Alert Dialog theme -->
    <item name="alertDialogTheme">@style/MyAlertDialogTheme</item>
</style>
<style name="MyAlertDialogTheme" parent="android:Theme.Dialog">
    <item name="android:fontFamily">@font/pacifico</item>
</style>

Any ideas or ways to make the preference dialogs look with the same font I have defined for the application?

Thanks!

Regards! enter image description here

Alex
  • 149
  • 2
  • 9
  • https://stackoverflow.com/a/34021740/6216498 – Farshad Asgharzadeh Aug 13 '18 at 08:20
  • In my case I am not the one creating the dialog preference, this dialog is created by the system when you click on an EditTextPreference. I would prefer to solve the problem by avoiding having to create a custom class where I have to create Alert Dialogs myself. – Alex Aug 13 '18 at 08:58
  • i use this library: you can set custom font to alert https://github.com/afollestad/material-dialogs – Farshad Asgharzadeh Aug 13 '18 at 09:38

0 Answers0