From 7aa4fbaba088dc91505d6b892101028b5338ac18 Mon Sep 17 00:00:00 2001 From: DHD2280 Date: Fri, 13 Dec 2024 21:35:58 +0100 Subject: [PATCH] DepthWallpaper: use constants for pref names Signed-off-by: DHD2280 --- .../hooks/systemui/lockscreen/DepthWallpaper.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/it/dhd/oxygencustomizer/xposed/hooks/systemui/lockscreen/DepthWallpaper.java b/app/src/main/java/it/dhd/oxygencustomizer/xposed/hooks/systemui/lockscreen/DepthWallpaper.java index a947c398..f84b0c11 100644 --- a/app/src/main/java/it/dhd/oxygencustomizer/xposed/hooks/systemui/lockscreen/DepthWallpaper.java +++ b/app/src/main/java/it/dhd/oxygencustomizer/xposed/hooks/systemui/lockscreen/DepthWallpaper.java @@ -18,6 +18,9 @@ import static it.dhd.oxygencustomizer.utils.Constants.DEPTH_BG_TAG; import static it.dhd.oxygencustomizer.utils.Constants.DEPTH_SUBJECT_TAG; import static it.dhd.oxygencustomizer.utils.Constants.Packages.SYSTEM_UI; +import static it.dhd.oxygencustomizer.utils.Constants.Preferences.DepthWallpaper.DEPTH_WALLPAPER_ENABLED; +import static it.dhd.oxygencustomizer.utils.Constants.Preferences.DepthWallpaper.DEPTH_WALLPAPER_MODE; +import static it.dhd.oxygencustomizer.utils.Constants.Preferences.DepthWallpaper.DEPTH_WALLPAPER_OPACITY; import static it.dhd.oxygencustomizer.utils.Constants.getLockScreenBitmapCachePath; import static it.dhd.oxygencustomizer.utils.Constants.getLockScreenSubjectCachePath; import static it.dhd.oxygencustomizer.xposed.XPrefs.Xprefs; @@ -122,14 +125,14 @@ public DepthWallpaper(Context context) { @Override public void updatePrefs(String... Key) { - DWallpaperEnabled = Xprefs.getBoolean("DWallpaperEnabled", false); - DWOpacity = Xprefs.getSliderInt("DWOpacity", 192); - DWMode = Integer.parseInt(Xprefs.getString("DWMode", "0")); + DWallpaperEnabled = Xprefs.getBoolean(DEPTH_WALLPAPER_ENABLED, false); + DWOpacity = Xprefs.getSliderInt(DEPTH_WALLPAPER_OPACITY, 192); + DWMode = Integer.parseInt(Xprefs.getString(DEPTH_WALLPAPER_MODE, "0")); if (Key.length > 0) { - if (Key[0].equals("DWallpaperEnabled")) { + if (Key[0].equals(DEPTH_WALLPAPER_ENABLED)) { setupViews(); - } else if (Key[0].equals("DWMode")) { + } else if (Key[0].equals(DEPTH_WALLPAPER_MODE)) { cleanFiles(); } }