diff --git a/OsmAnd/res/layout/menu_obj_selection_fragment.xml b/OsmAnd/res/layout/menu_obj_selection_fragment.xml index 7d82e49eda..94cc9bf412 100644 --- a/OsmAnd/res/layout/menu_obj_selection_fragment.xml +++ b/OsmAnd/res/layout/menu_obj_selection_fragment.xml @@ -1,36 +1,20 @@ - + - + android:layout_height="match_parent" + android:divider="@null" + android:dividerHeight="0dp"> - + - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ObjectSelectionMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ObjectSelectionMenu.java index 7923e200cf..664899f8eb 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ObjectSelectionMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ObjectSelectionMenu.java @@ -116,6 +116,10 @@ public class ObjectSelectionMenu extends BaseMenuController { public static void show(LatLon latLon, Map selectedObjects, MapActivity mapActivity) { + if (isVisible(mapActivity)) { + hide(mapActivity); + } + ObjectSelectionMenu menu = new ObjectSelectionMenu(latLon, mapActivity); menu.createCollection(selectedObjects); ObjectSelectionMenuFragment.showInstance(menu); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ObjectSelectionMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ObjectSelectionMenuFragment.java index 528dfbadd1..fb0fa674eb 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ObjectSelectionMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ObjectSelectionMenuFragment.java @@ -107,8 +107,6 @@ public class ObjectSelectionMenuFragment extends Fragment implements AdapterView private void buildHeader(View view, MenuObject item, MapActivity mapActivity) { IconsCache iconsCache = mapActivity.getMyApplication().getIconsCache(); - boolean light = mapActivity.getMyApplication().getSettings().isLightContent(); - final View iconLayout = view.findViewById(R.id.context_menu_icon_layout); final ImageView iconView = (ImageView) view.findViewById(R.id.context_menu_icon_view); Drawable icon = item.getLeftIcon(); @@ -118,7 +116,7 @@ public class ObjectSelectionMenuFragment extends Fragment implements AdapterView iconLayout.setVisibility(View.VISIBLE); } else if (iconId != 0) { iconView.setImageDrawable(iconsCache.getIcon(iconId, - light ? R.color.osmand_orange : R.color.osmand_orange_dark, 0.75f)); + menu.isLight() ? R.color.osmand_orange : R.color.osmand_orange_dark, 0.75f)); iconLayout.setVisibility(View.VISIBLE); } else { iconLayout.setVisibility(View.GONE); diff --git a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java index c73acec303..091392c6d0 100644 --- a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java @@ -128,6 +128,7 @@ public class ContextMenuLayer extends OsmandMapLayer { if (latLon == null) { latLon = getLatLon(point, tileBox); } + hideVisibleMenues(); menu.show(latLon, pointDescription, selectedObj); return true; @@ -136,6 +137,7 @@ public class ContextMenuLayer extends OsmandMapLayer { return true; } else if (showUnknownLocation) { + hideVisibleMenues(); menu.show(getLatLon(point, tileBox), null, null); return true; } @@ -217,6 +219,7 @@ public class ContextMenuLayer extends OsmandMapLayer { @Override public boolean onSingleTap(PointF point, RotatedTileBox tileBox) { if (pressedContextMarker(tileBox, point.x, point.y)) { + hideVisibleMenues(); menu.show(); return true; } @@ -237,11 +240,17 @@ public class ContextMenuLayer extends OsmandMapLayer { } } - ObjectSelectionMenu.hide(activity); + hideVisibleMenues(); menu.onSingleTapOnMap(); return false; } + private void hideVisibleMenues() { + if (ObjectSelectionMenu.isVisible(activity)) { + ObjectSelectionMenu.hide(activity); + } + } + private void showContextMenuForSelectedObjects(final LatLon latLon, final Map selectedObjects) { ObjectSelectionMenu.show(latLon, selectedObjects, activity); }