Last active
July 19, 2016 20:19
-
-
Save mahdimortazavi/4ebab49077a083e7470d76d6581ad3f7 to your computer and use it in GitHub Desktop.
change font all application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add dependency | |
compile 'uk.co.chrisjenx:calligraphy:2.2.0' | |
------------------------------------------------ | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
CalligraphyConfig.initDefault(new CalligraphyConfig.Builder() | |
.setDefaultFontPath("fonts/irsensnumeral.ttf") | |
.setFontAttrId(R.attr.fontPath) | |
.build() | |
); | |
setContentView(R.layout.activity_main); | |
} | |
@Override | |
protected void attachBaseContext(Context newBase) { | |
super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment