mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-17 12:00:10 -07:00
Move dir
This commit is contained in:
parent
273fa6f952
commit
cadb0ab12f
313 changed files with 206 additions and 14 deletions
|
|
@ -0,0 +1,34 @@
|
|||
package net.kdt.pojavlaunch;
|
||||
|
||||
import android.content.res.*;
|
||||
import android.graphics.*;
|
||||
import android.view.*;
|
||||
import android.widget.*;
|
||||
import android.content.*;
|
||||
import com.kdt.mcgui.*;
|
||||
|
||||
public class FontChanger
|
||||
{
|
||||
private static Typeface fNotoSans, fMinecraftTen;
|
||||
|
||||
public static void initFonts(Context ctx) {
|
||||
fNotoSans = Typeface.createFromAsset(ctx.getAssets(), "font/NotoSans-Bold.ttf");
|
||||
fMinecraftTen = Typeface.createFromAsset(ctx.getAssets(), "font/minecraft-ten.ttf");
|
||||
}
|
||||
|
||||
public static void changeFonts(ViewGroup viewTree) {
|
||||
View child;
|
||||
for(int i = 0; i < viewTree.getChildCount(); ++i) {
|
||||
child = viewTree.getChildAt(i);
|
||||
if (child instanceof ViewGroup) {
|
||||
changeFonts((ViewGroup) child);
|
||||
} else if (child instanceof TextView) {
|
||||
changeFont((TextView) child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void changeFont(TextView view) {
|
||||
view.setTypeface(view instanceof MineButton ? fMinecraftTen : fNotoSans);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue