From 2f34c1313b72ace11a889f02928f8bd318905242 Mon Sep 17 00:00:00 2001 From: jhengazuki Date: Sun, 14 Sep 2025 02:21:47 +0800 Subject: [PATCH] Fix bug --- .../android/tv/ui/custom/CustomWallView.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/fongmi/android/tv/ui/custom/CustomWallView.java b/app/src/main/java/com/fongmi/android/tv/ui/custom/CustomWallView.java index a5a64db3c..ffe970adc 100644 --- a/app/src/main/java/com/fongmi/android/tv/ui/custom/CustomWallView.java +++ b/app/src/main/java/com/fongmi/android/tv/ui/custom/CustomWallView.java @@ -61,19 +61,27 @@ public class CustomWallView extends FrameLayout { } private void refresh() { - if (Setting.getWall() == 0) load(FileUtil.getWall(Setting.getWall())); - else image.setImageResource(ResUtil.getDrawable("wallpaper_" + Setting.getWall())); + load(FileUtil.getWall(Setting.getWall())); } private void load(File file) { - if (isVideo(file)) loadVideo(file); + if (!file.getName().endsWith("0")) loadRes(ResUtil.getDrawable(file.getName())); + else if (isVideo(file)) loadVideo(file); else loadImage(file); } + private void loadRes(int resId) { + video.setPlayer(null); + video.setVisibility(GONE); + image.setVisibility(VISIBLE); + image.setImageResource(resId); + WallConfig.get().getPlayer().clearMediaItems(); + } + private void loadImage(File file) { video.setPlayer(null); - ImgUtil.load(file, image); video.setVisibility(GONE); + ImgUtil.load(file, image); image.setVisibility(VISIBLE); WallConfig.get().getPlayer().clearMediaItems(); }