Everyone
I want to apply my custom font to whole application not just a textview or not for an activity. if it is possible make just change in manifest file so it is easy for me.
so help me out.
Everyone
I want to apply my custom font to whole application not just a textview or not for an activity. if it is possible make just change in manifest file so it is easy for me.
so help me out.
You can create custom textview class and use that class whenever you need to use custom fonts.
Check this link: How to make a custom TextView?
Try this method for all activity. Or you can make this method in you utility class and use in you activity class see bellow.
Method in your utility.java
file.
public static void setFont(ViewGroup group, Typeface font) {
int count = group.getChildCount();
View v;
for (int i = 0; i < count; i++) {
v = group.getChildAt(i);
if (v instanceof TextView || v instanceof EditText
|| v instanceof Button) {
((TextView) v).setTypeface(font);
} else if (v instanceof ViewGroup)
setFont((ViewGroup) v, font);
}
}
And then in your Activity.java
file.
ll_Homescreen = (LinearLayout) findViewById(R.id.ll_Homescreen);
FontStyle = Typeface.createFromAsset(getAssets(), path of you font);
utility.setFont(ll_Homescreen, FontStyle);
I hope this will help you Happy Coding.