Skip to content

Commit

Permalink
CHANGELOG: A14ap11b2: Fixed light QS theme
Browse files Browse the repository at this point in the history
  • Loading branch information
siavash79 committed Dec 13, 2023
1 parent 4209b75 commit 70833c8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/edit2MakeNewCanary
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Editing this file will trigger the build script for a new canary.
Editing this file will trigger the build script for a new canary..
26 changes: 26 additions & 0 deletions .idea/appInsightsSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import static de.robv.android.xposed.XposedHelpers.getObjectField;
import static de.robv.android.xposed.XposedHelpers.setObjectField;
import static sh.siava.pixelxpert.modpacks.XPrefs.Xprefs;
import static sh.siava.pixelxpert.modpacks.utils.Helpers.dumpClass;
import static sh.siava.pixelxpert.modpacks.utils.Helpers.findMethod;

import android.annotation.SuppressLint;
Expand Down Expand Up @@ -194,8 +195,9 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
Class<?> StateFlowImplClass = findClass("kotlinx.coroutines.flow.StateFlowImpl", lpparam.classLoader);
Class<?> ReadonlyStateFlowClass = findClass("kotlinx.coroutines.flow.ReadonlyStateFlow", lpparam.classLoader);

dumpClass(ReadonlyStateFlowClass);
Object zeroAlphaFlow = StateFlowImplClass.getConstructor(Object.class).newInstance(0f);
setObjectField(param.thisObject, "backgroundAlpha", ReadonlyStateFlowClass.getConstructor(StateFlowImplClass).newInstance(zeroAlphaFlow));
setObjectField(param.thisObject, "backgroundAlpha", ReadonlyStateFlowClass.getConstructors()[0].newInstance(zeroAlphaFlow));
}
});

Expand Down Expand Up @@ -334,15 +336,19 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
}
});

hookAllMethods(BatteryStatusChipClass, findMethod(BatteryStatusChipClass, "updateResources.*").getName(), new XC_MethodHook() { //background color of 14's charging chip. Fix for light QS theme situation
XC_MethodHook updateResourcesHook = new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
if (!isDark)
((LinearLayout) getObjectField(param.thisObject, "roundedContainer"))
.getBackground()
.setTint(colorInactive);
}
});
};

hookAllConstructors(BatteryStatusChipClass, updateResourcesHook);
hookAllMethods(BatteryStatusChipClass, "onConfigurationChanged", updateResourcesHook);

hookAllMethods(BrightnessSliderViewClass, "onFinishInflate", new XC_MethodHook() { //brightness slider
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
Expand Down

0 comments on commit 70833c8

Please sign in to comment.