From 9f314907938661bae94d0db1cc741d26cb1c64b9 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 19 Aug 2020 17:59:49 +0200 Subject: [PATCH] Combine ids to make context menu appearance persistent --- .../src/net/osmand/plus/activities/MapActivityActions.java | 3 +-- OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 57c499407f..0a6bc44260 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -400,7 +400,7 @@ public class MapActivityActions implements DialogProvider { ContextMenuItem editGpxItem = new ItemBuilder() .setTitleId(R.string.context_menu_item_edit_waypoint, mapActivity) - .setId(MAP_CONTEXT_MENU_EDIT_GPX_WP) + .setId(MAP_CONTEXT_MENU_ADD_GPX_WAYPOINT) .setIcon(R.drawable.ic_action_edit_dark) .setOrder(EDIT_GPX_WAYPOINT_ITEM_ORDER) .setListener(listener).createItem(); @@ -412,7 +412,6 @@ public class MapActivityActions implements DialogProvider { .setListener(listener).createItem(); if (all) { - adapter.addItem(editGpxItem); adapter.addItem(addGpxItem); } else if (selectedObj instanceof WptPt && getMyApplication().getSelectedGpxHelper().getSelectedGPXFile((WptPt) selectedObj) != null) { diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java index 00ea982116..121536418e 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java @@ -265,14 +265,14 @@ public class OsmEditingPlugin extends OsmandPlugin { } if (isEditable) { adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.poi_context_menu_modify, mapActivity) - .setId(MAP_CONTEXT_MENU_MODIFY_POI) + .setId(MAP_CONTEXT_MENU_CREATE_POI) .setIcon(R.drawable.ic_action_edit_dark) .setOrder(MODIFY_POI_ITEM_ORDER) .setListener(listener) .createItem()); } else if (selectedObj instanceof OpenstreetmapPoint && ((OpenstreetmapPoint) selectedObj).getAction() != Action.DELETE) { adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.poi_context_menu_modify_osm_change, mapActivity) - .setId(MAP_CONTEXT_MENU_MODIFY_OSM_CHANGE) + .setId(MAP_CONTEXT_MENU_CREATE_POI) .setIcon(R.drawable.ic_action_edit_dark) .setOrder(MODIFY_OSM_CHANGE_ITEM_ORDER) .setListener(listener) @@ -287,7 +287,7 @@ public class OsmEditingPlugin extends OsmandPlugin { } if (selectedObj instanceof OsmNotesPoint) { adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.context_menu_item_modify_note, mapActivity) - .setId(MAP_CONTEXT_MENU_MODIFY_OSM_NOTE) + .setId(MAP_CONTEXT_MENU_OPEN_OSM_NOTE) .setIcon(R.drawable.ic_action_edit_dark) .setOrder(MODIFY_OSM_NOTE_ITEM_ORDER) .setListener(listener)