Fixed missing menu item in landscape.

This commit is contained in:
GaidamakUA 2016-05-26 16:20:30 +03:00
parent 1245ba5a3d
commit d2cd8d2dee

View file

@ -134,12 +134,7 @@ public class ContextMenuLayer extends OsmandMapLayer {
ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
@Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> 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);
}
return true;
}
};
@ -148,7 +143,16 @@ public class ContextMenuLayer extends OsmandMapLayer {
.setIcon(R.drawable.ic_action_note_dark)
.setListener(listener)
.createItem());
}
if (isObjectMoveable(o)) {
ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
@Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> 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)
@ -156,7 +160,6 @@ public class ContextMenuLayer extends OsmandMapLayer {
.createItem());
}
}
}
@Override
@RequiresPermission(Manifest.permission.VIBRATE)