[Suggestion][Launcher mod] Make app titles bold #230

Open
opened 2 years ago by Mino260806 · 2 comments

Tested on MIUI 12.5.15 running android 11. Probably MIUI version won't be a problem anyway.

XposedHelpers.findAndHookMethod("android.widget.TextView", lpparam.classLoader, "setTypeface", Typeface.class, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
    String className = param.thisObject.getClass().getName();									
    if (className.equals("com.miui.home.launcher.TitleTextView"))
	    XposedBridge.invokeOriginalMethod(param.method, param.thisObject, new Object[] { Typeface.create((Typeface)param.args[0], Typeface.BOLD) });
}
});

Looks nicer than normal titles.

Tested on MIUI 12.5.15 running android 11. Probably MIUI version won't be a problem anyway. ``` XposedHelpers.findAndHookMethod("android.widget.TextView", lpparam.classLoader, "setTypeface", Typeface.class, new XC_MethodHook() { @Override protected void afterHookedMethod(MethodHookParam param) throws Throwable { String className = param.thisObject.getClass().getName(); if (className.equals("com.miui.home.launcher.TitleTextView")) XposedBridge.invokeOriginalMethod(param.method, param.thisObject, new Object[] { Typeface.create((Typeface)param.args[0], Typeface.BOLD) }); } }); ``` Looks nicer than normal titles.
Owner

Android version also. It's probably more optimal to hook TitleTextView though, or even com.miui.home.launcher.ItemIcon and change mTitle there.

Android version also. It's probably more optimal to hook TitleTextView though, or even *com.miui.home.launcher.ItemIcon* and change mTitle there.
Poster

Android version also. It's probably more optimal to hook TitleTextView though, or even com.miui.home.launcher.ItemIcon and change mTitle there.

I don't know bro sorry. I tried hooking all sorts of methods inside ItemIcon or TitleTextView but nothing changes. Probably changes are reverted back in somewhere else I didn't figure so I used this method. Also, hooking TextView.setTypeface won't be a big deal, when I logged the results it gets called less than 20 times. So it's reasonable to just keep it like that.

> Android version also. It's probably more optimal to hook TitleTextView though, or even *com.miui.home.launcher.ItemIcon* and change mTitle there. I don't know bro sorry. I tried hooking all sorts of methods inside ItemIcon or TitleTextView but nothing changes. Probably changes are reverted back in somewhere else I didn't figure so I used this method. Also, hooking TextView.setTypeface won't be a big deal, when I logged the results it gets called less than 20 times. So it's reasonable to just keep it like that.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Mikanoshi/CustoMIUIzer#230
Loading…
There is no content yet.