From 1f3ca9388afe2bf6ac59798d0da6ec125226cdff Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Tue, 3 Oct 2017 14:46:28 +0300 Subject: [PATCH] Fix creating items on context menu --- .../net/osmand/plus/osmedit/OsmEditingPlugin.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java index 39190c82d2..b73f443771 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java @@ -223,15 +223,10 @@ public class OsmEditingPlugin extends OsmandPlugin { .setListener(listener) .createItem()); } - if (selectedObj instanceof OsmNotesPoint) { - adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.context_menu_item_modify_note, mapActivity) - .setIcon(R.drawable.ic_action_bug_dark) - .setListener(listener).createItem()); - } else { - adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.context_menu_item_open_note, mapActivity) - .setIcon(R.drawable.ic_action_bug_dark) - .setListener(listener).createItem()); - } + adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(selectedObj instanceof OsmNotesPoint ? R.string.context_menu_item_modify_note : + R.string.context_menu_item_open_note, mapActivity) + .setIcon(R.drawable.ic_action_bug_dark) + .setListener(listener).createItem()); } public void openOsmNote(MapActivity mapActivity, double latitude, double longitude) {