diff --git a/app/src/main/java/com/drdisagree/iconify/xposed/mods/QSLightThemeA12.java b/app/src/main/java/com/drdisagree/iconify/xposed/mods/QSLightThemeA12.java index e0f8da6d9..0cf886815 100644 --- a/app/src/main/java/com/drdisagree/iconify/xposed/mods/QSLightThemeA12.java +++ b/app/src/main/java/com/drdisagree/iconify/xposed/mods/QSLightThemeA12.java @@ -195,30 +195,28 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable { for (Object constant : constants) { String enumVal = constant.toString(); switch (enumVal) { - case "KEYGUARD": - findAndHookMethod(constant.getClass(), "prepare", ScrimStateEnum, new XC_MethodHook() { - @Override - protected void afterHookedMethod(MethodHookParam param) throws Throwable { - if (!lightQSHeaderEnabled) return; - - boolean mClipQsScrim = (boolean) getObjectField(param.thisObject, "mClipQsScrim"); - if (mClipQsScrim) { - callMethod(param.thisObject, "updateScrimColor", getObjectField(param.thisObject, "mScrimBehind"), 1f, Color.TRANSPARENT); + case "KEYGUARD" -> + findAndHookMethod(constant.getClass(), "prepare", ScrimStateEnum, new XC_MethodHook() { + @Override + protected void afterHookedMethod(MethodHookParam param) throws Throwable { + if (!lightQSHeaderEnabled) return; + + boolean mClipQsScrim = (boolean) getObjectField(param.thisObject, "mClipQsScrim"); + if (mClipQsScrim) { + callMethod(param.thisObject, "updateScrimColor", getObjectField(param.thisObject, "mScrimBehind"), 1f, Color.TRANSPARENT); + } } - } - }); - break; - case "BOUNCER": - findAndHookMethod(constant.getClass(), "prepare", ScrimStateEnum, new XC_MethodHook() { - @Override - protected void afterHookedMethod(MethodHookParam param) throws Throwable { - if (!lightQSHeaderEnabled) return; - - setObjectField(param.thisObject, "mBehindTint", Color.TRANSPARENT); - } - }); - break; - case "SHADE_LOCKED": + }); + case "BOUNCER" -> + findAndHookMethod(constant.getClass(), "prepare", ScrimStateEnum, new XC_MethodHook() { + @Override + protected void afterHookedMethod(MethodHookParam param) throws Throwable { + if (!lightQSHeaderEnabled) return; + + setObjectField(param.thisObject, "mBehindTint", Color.TRANSPARENT); + } + }); + case "SHADE_LOCKED" -> { hookAllMethods(constant.getClass(), "prepare", new XC_MethodHook() { @Override protected void afterHookedMethod(MethodHookParam param) throws Throwable { @@ -239,20 +237,18 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable { param.setResult(Color.TRANSPARENT); } }); - break; - - case "UNLOCKED": - findAndHookMethod(constant.getClass(), "prepare", ScrimStateEnum, new XC_MethodHook() { - @Override - protected void afterHookedMethod(MethodHookParam param) throws Throwable { - if (!lightQSHeaderEnabled) return; + } + case "UNLOCKED" -> + findAndHookMethod(constant.getClass(), "prepare", ScrimStateEnum, new XC_MethodHook() { + @Override + protected void afterHookedMethod(MethodHookParam param) throws Throwable { + if (!lightQSHeaderEnabled) return; - setObjectField(param.thisObject, "mBehindTint", Color.TRANSPARENT); + setObjectField(param.thisObject, "mBehindTint", Color.TRANSPARENT); - callMethod(param.thisObject, "updateScrimColor", getObjectField(param.thisObject, "mScrimBehind"), 1f, Color.TRANSPARENT); - } - }); - break; + callMethod(param.thisObject, "updateScrimColor", getObjectField(param.thisObject, "mScrimBehind"), 1f, Color.TRANSPARENT); + } + }); } } } catch (Throwable throwable) {