From d2cd8d2dee5dc970baa7d9190e122e9a2f935148 Mon Sep 17 00:00:00 2001 From: GaidamakUA Date: Thu, 26 May 2016 16:20:30 +0300 Subject: [PATCH] Fixed missing menu item in landscape. --- .../osmand/plus/views/ContextMenuLayer.java | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java index 695cabd95c..cb18b588ed 100644 --- a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java @@ -134,12 +134,7 @@ public class ContextMenuLayer extends OsmandMapLayer { ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() { @Override public boolean onContextMenuClick(ArrayAdapter adapter, int itemId, int pos, boolean isChecked) { - if (itemId == R.string.shared_string_show_description) { - menu.openMenuFullScreen(); - } else if (itemId == R.string.change_markers_position) { - RotatedTileBox tileBox = activity.getMapView().getCurrentRotatedTileBox(); - enterMovingMode(tileBox); - } + menu.openMenuFullScreen(); return true; } }; @@ -148,13 +143,21 @@ public class ContextMenuLayer extends OsmandMapLayer { .setIcon(R.drawable.ic_action_note_dark) .setListener(listener) .createItem()); - if (isObjectMoveable(o)) { - adapter.addItem(new ContextMenuItem.ItemBuilder() - .setTitleId(R.string.change_markers_position, activity) - .setIcon(R.drawable.ic_show_on_map) - .setListener(listener) - .createItem()); - } + } + if (isObjectMoveable(o)) { + ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() { + @Override + public boolean onContextMenuClick(ArrayAdapter adapter, int itemId, int pos, boolean isChecked) { + RotatedTileBox tileBox = activity.getMapView().getCurrentRotatedTileBox(); + enterMovingMode(tileBox); + return true; + } + }; + adapter.addItem(new ContextMenuItem.ItemBuilder() + .setTitleId(R.string.change_markers_position, activity) + .setIcon(R.drawable.ic_show_on_map) + .setListener(listener) + .createItem()); } }