diff --git a/app/src/main/java/io/xpipe/app/browser/icon/FileIconManager.java b/app/src/main/java/io/xpipe/app/browser/icon/FileIconManager.java index 56f03ea4c..6af408cf1 100644 --- a/app/src/main/java/io/xpipe/app/browser/icon/FileIconManager.java +++ b/app/src/main/java/io/xpipe/app/browser/icon/FileIconManager.java @@ -11,7 +11,7 @@ public class FileIconManager { public static synchronized void loadIfNecessary() { if (!loaded) { - AppImages.loadDirectory(AppResources.XPIPE_MODULE, "browser_icons"); + AppImages.loadDirectory(AppResources.XPIPE_MODULE, "browser_icons", true, false); loaded = true; } } diff --git a/app/src/main/java/io/xpipe/app/core/AppImages.java b/app/src/main/java/io/xpipe/app/core/AppImages.java index 07fcdc688..7a4dc4c6d 100644 --- a/app/src/main/java/io/xpipe/app/core/AppImages.java +++ b/app/src/main/java/io/xpipe/app/core/AppImages.java @@ -30,11 +30,11 @@ public class AppImages { TrackEvent.info("Loading images ..."); for (var module : AppExtensionManager.getInstance().getContentModules()) { - loadDirectory(module.getName(), "img"); + loadDirectory(module.getName(), "img", true, true); } } - public static void loadDirectory(String module, String dir) { + public static void loadDirectory(String module, String dir, boolean loadImages, boolean loadSvgs) { AppResources.with(module, dir, basePath -> { if (!Files.exists(basePath)) { return; @@ -48,10 +48,10 @@ public class AppImages { var relativeFileName = FilenameUtils.separatorsToUnix( basePath.relativize(file).toString()); try { - if (FilenameUtils.getExtension(file.toString()).equals("svg")) { + if (FilenameUtils.getExtension(file.toString()).equals("svg") && loadSvgs) { var s = Files.readString(file); svgImages.put(defaultPrefix + relativeFileName, s); - } else { + } else if (loadImages) { images.put(defaultPrefix + relativeFileName, loadImage(file)); } } catch (IOException ex) {