Skip to content

Commit

Permalink
Fix notifications not showing while using depth wallpaper
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmud0808 committed Sep 21, 2023
1 parent 5a89f47 commit fd28fc0
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import static com.drdisagree.iconify.config.XPrefs.Xprefs;
import static de.robv.android.xposed.XposedBridge.hookAllMethods;
import static de.robv.android.xposed.XposedHelpers.findClass;
import static de.robv.android.xposed.XposedHelpers.getObjectField;

import android.annotation.SuppressLint;
import android.content.Context;
Expand Down Expand Up @@ -125,6 +126,21 @@ protected void afterHookedMethod(MethodHookParam param) {
updateWallpaper();
}
});

Class<?> NotificationPanelViewControllerClass = findClass(SYSTEMUI_PACKAGE + ".shade.NotificationPanelViewController", lpparam.classLoader);

hookAllMethods(NotificationPanelViewControllerClass, "onFinishInflate", new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) {
if (!showDepthWallpaper) return;

View mView = (View) getObjectField(param.thisObject, "mView");
View keyguardBottomArea = mView.findViewById(mContext.getResources().getIdentifier("keyguard_bottom_area", "id", mContext.getPackageName()));
ViewGroup parent = (ViewGroup) keyguardBottomArea.getParent();
parent.removeView(keyguardBottomArea);
parent.addView(keyguardBottomArea, 0);
}
});
}

private void updateWallpaper() {
Expand Down

0 comments on commit fd28fc0

Please sign in to comment.