0

I have an app and i'm trying to change the whole app font, from default to "Assistant-Light" font.

I searched the web and tried all the solutions that suggested but still the same result.

I created a font folder, with the font (assistant_light.ttf) and font family (assistant_font.xml) files.

I've tried to change the font from the styles.xml file and set it as a theme for the app like this:

styles.xml

<style name="AppTheme" parent="Base.Theme.AppCompat">
    <item name="android:fontFamily">@font/assistant_font</item>
</style>

MainActivity.java

protected void onCreate(Bundle savedInstanceState) {
    setTheme(R.style.AppTheme);
    super.onCreate(savedInstanceState);
    // rest of code...

The min SDK version is 19, and my device Android version is 4.4.2

Any idea how to fix it?

Thanks!

Yuvalta
  • 5
  • 6
  • check my [answer](https://stackoverflow.com/a/59264833/7948109), maybe this will help! – Rahul Gaur Feb 24 '20 at 08:17
  • it works! but only for a single view. how can I do it for the whole app? – Yuvalta Feb 24 '20 at 08:31
  • Sorry can't help you with that, applying font in base theme should work, but If for some reason you are unable to find solution you can use my method to change font 1 by 1 – Rahul Gaur Feb 24 '20 at 08:35

0 Answers0