diff --git a/OsmAnd/src/net/osmand/plus/CustomOsmandPlugin.java b/OsmAnd/src/net/osmand/plus/CustomOsmandPlugin.java index b35e158253..c92b9f8ed9 100644 --- a/OsmAnd/src/net/osmand/plus/CustomOsmandPlugin.java +++ b/OsmAnd/src/net/osmand/plus/CustomOsmandPlugin.java @@ -328,25 +328,11 @@ public class CustomOsmandPlugin extends OsmandPlugin { File[] files = pluginResDir.listFiles(); for (File resFile : files) { String path = resFile.getAbsolutePath(); - for (Map.Entry entry : iconNames.entrySet()) { - String value = entry.getValue(); - if (value.startsWith("@")) { - value = value.substring(1); - if (path.endsWith(value)) { - icon = BitmapDrawable.createFromPath(path); - break; - } - } + if (icon == null) { + icon = getIconForFile(path, iconNames); } - for (Map.Entry entry : imageNames.entrySet()) { - String value = entry.getValue(); - if (value.startsWith("@")) { - value = value.substring(1); - if (path.endsWith(value)) { - image = BitmapDrawable.createFromPath(path); - break; - } - } + if (image == null) { + image = getIconForFile(path, imageNames); } } } @@ -354,6 +340,19 @@ public class CustomOsmandPlugin extends OsmandPlugin { } } + private Drawable getIconForFile(String path, Map fileNames) { + for (Map.Entry entry : fileNames.entrySet()) { + String value = entry.getValue(); + if (value.startsWith("@")) { + value = value.substring(1); + } + if (path.endsWith(value)) { + return BitmapDrawable.createFromPath(path); + } + } + return null; + } + @NonNull @Override public Drawable getLogoResource() { diff --git a/OsmAnd/src/net/osmand/plus/dialogs/PluginInstalledBottomSheetDialog.java b/OsmAnd/src/net/osmand/plus/dialogs/PluginInstalledBottomSheetDialog.java index 2e884f8022..d9f37eaf11 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/PluginInstalledBottomSheetDialog.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/PluginInstalledBottomSheetDialog.java @@ -91,7 +91,7 @@ public class PluginInstalledBottomSheetDialog extends MenuBottomSheetDialogFragm BaseBottomSheetItem pluginTitle = new SimpleBottomSheetItem.Builder() .setTitle(pluginTitleSpan) .setTitleColorId(nightMode ? R.color.active_color_primary_dark : R.color.active_color_primary_light) - .setIcon(getContentIcon(R.drawable.ic_extension_dark)) + .setIcon(plugin.getLogoResource()) .setLayoutId(R.layout.bottom_sheet_item_simple_56dp) .create(); items.add(pluginTitle);