From 37eb2fda7c81387baebbac91df576595edd7f660 Mon Sep 17 00:00:00 2001 From: hugh <1012760428@qq.com> Date: Sat, 31 Jan 2026 17:16:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A1=AE=E4=BF=9D=E5=8F=8C=E5=87=BB?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=9A=84=E6=8C=81=E4=B9=85=E5=8C=96=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E5=B7=A5=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 WallpaperPreferences 中添加 KEY_DOUBLE_TAP_ENABLED 常量 - 在 loadConfig 方法中加载双击配置(默认值为 true) - 在 saveConfig 方法中保存双击配置到 SharedPreferences - 确保配置在应用重启后能正确恢复 Co-Authored-By: Claude Sonnet 4.5 --- .../cn/hugh/bz/gk2/wallpaper/WallpaperPreferences.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/cn/hugh/bz/gk2/wallpaper/WallpaperPreferences.java b/app/src/main/java/cn/hugh/bz/gk2/wallpaper/WallpaperPreferences.java index 8870748..55be85d 100644 --- a/app/src/main/java/cn/hugh/bz/gk2/wallpaper/WallpaperPreferences.java +++ b/app/src/main/java/cn/hugh/bz/gk2/wallpaper/WallpaperPreferences.java @@ -20,6 +20,7 @@ public class WallpaperPreferences { private static final String KEY_VIDEO_ENABLED = "video_enabled"; private static final String KEY_VIDEO_MUTED = "video_muted"; private static final String KEY_VIDEO_PAUSE_ON_BATTERY = "video_pause_on_battery"; + private static final String KEY_DOUBLE_TAP_ENABLED = "double_tap_enabled"; private final SharedPreferences prefs; private final Gson gson; @@ -121,6 +122,9 @@ public class WallpaperPreferences { config.setVideoMuted(prefs.getBoolean(KEY_VIDEO_MUTED, true)); config.setVideoPauseOnBattery(prefs.getBoolean(KEY_VIDEO_PAUSE_ON_BATTERY, true)); + // Global double tap setting from SharedPreferences + config.setDoubleTapEnabled(prefs.getBoolean(KEY_DOUBLE_TAP_ENABLED, true)); + // 添加日志:记录从相册加载的图片和视频数量 android.util.Log.i("WallpaperPreferences", "loadConfig: album=" + album.getName() + ", folders=" + album.getFolders().size() + @@ -143,6 +147,9 @@ public class WallpaperPreferences { config.setVideoMuted(true); config.setVideoPauseOnBattery(true); + // Default double tap setting + config.setDoubleTapEnabled(true); + android.util.Log.w("WallpaperPreferences", "loadConfig: No active album found"); } @@ -186,6 +193,7 @@ public class WallpaperPreferences { .putBoolean(KEY_VIDEO_ENABLED, config.isVideoEnabled()) .putBoolean(KEY_VIDEO_MUTED, config.isVideoMuted()) .putBoolean(KEY_VIDEO_PAUSE_ON_BATTERY, config.isVideoPauseOnBattery()) + .putBoolean(KEY_DOUBLE_TAP_ENABLED, config.isDoubleTapEnabled()) .apply(); } public void saveLastUri(String uri) {