diff --git a/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java b/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java index d355115e99..6bf5b4eeec 100644 --- a/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java +++ b/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java @@ -182,10 +182,10 @@ public class ContextMenuAdapter { } else { if (item.getIcon() != ContextMenuItem.INVALID_ID) { int colorRes = item.getColorRes(); - if (colorRes == ContextMenuItem.INVALID_ID) { + if (colorRes == ContextMenuItem.INVALID_ID && !item.shouldSkipPainting()) { colorRes = lightTheme ? R.color.icon_color : R.color.color_white; } - Drawable drawable = mIconsCache.getIcon(item.getIcon(), colorRes); + final Drawable drawable = mIconsCache.getIcon(item.getIcon(), colorRes); ((AppCompatImageView) convertView.findViewById(R.id.icon)).setImageDrawable(drawable); convertView.findViewById(R.id.icon).setVisibility(View.VISIBLE); } else if (convertView.findViewById(R.id.icon) != null) { diff --git a/OsmAnd/src/net/osmand/plus/ContextMenuItem.java b/OsmAnd/src/net/osmand/plus/ContextMenuItem.java index ff3eb0c45a..0805ee2ee4 100644 --- a/OsmAnd/src/net/osmand/plus/ContextMenuItem.java +++ b/OsmAnd/src/net/osmand/plus/ContextMenuItem.java @@ -142,6 +142,10 @@ public class ContextMenuItem { return integerListener; } + public boolean shouldSkipPainting() { + return skipPaintingWithoutColor; + } + public boolean shouldHideDivider() { return hideDivider; } diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java index 3bb9417b2e..a7abd7b45c 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java @@ -54,7 +54,6 @@ import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map.Entry; -import java.util.Set; /** * Object is responsible to maintain layers using by map activity @@ -322,7 +321,8 @@ public class MapActivityLayers { } else { builder.setIcon(R.drawable.mx_user_defined); } - builder.setColor(R.color.osmand_orange); + builder.setColor(ContextMenuItem.INVALID_ID); + builder.setSkipPaintingWithoutColor(true); adapter.addItem(builder.createItem()); }