Add Custom Font to Entire Android Application in Application Level

In a Single shot change font of Entire Android Application

Kindly use the following links to use this library:

In build.gradle (Project)

allprojects {
repositories {

maven { url “https://jitpack.io" }
}
}

And then in the other gradle file(may be your app gradle or your own module library gradle, but never add in both of them to avoid conflict.)

dependencies {
compile ‘com.github.myinnos:SingleShotFontChange:1.0’
}

How to use
— — -
Step 1: add default font to styles, Here i added serif font as default:

<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:typeface”>serif</item>
</style>

Step 2: add custom font in application level to override style font:

public class AppBaseApplication extends Application {

@Override
public void onCreate() {
super.onCreate();
// custom font for entire App
TypefaceUtil.overrideFont(getApplicationContext(), “SERIF”, “fonts/Montserrat-Regular.ttf”);
}
Source : GITHUB

--

--

Mobile Engineer, UI/UX. I believe in the quote, “Creativity is thinking up new things. Innovation is doing new things.” Happy Coding :)

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Prabhakar Thota

Prabhakar Thota

Mobile Engineer, UI/UX. I believe in the quote, “Creativity is thinking up new things. Innovation is doing new things.” Happy Coding :)