From b904e2d2055abcec73da9bf6932022d06e35c082 Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Mon, 9 Oct 2017 12:09:24 +0300 Subject: [PATCH] Fix #3753 --- .../src/net/osmand/plus/mapcontextmenu/MapContextMenu.java | 7 +++++++ OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index 3afdfbdf74..303f119c3f 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -398,6 +398,13 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL if (fragmentRef != null) { fragmentRef.get().rebuildMenu(centerMarker); } + ContextMenuLayer contextMenuLayer = mapActivity.getMapLayers().getContextMenuLayer(); + for (OsmandMapLayer layer : mapActivity.getMapView().getLayers()) { + if (layer instanceof ContextMenuLayer.IMoveObjectProvider && ((ContextMenuLayer.IMoveObjectProvider) layer).isObjectMovable(object)) { + contextMenuLayer.setSelectedObjectContextMenuProvider((ContextMenuLayer.IContextMenuProvider) layer); + break; + } + } centerMarker = false; } diff --git a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java index 14902589be..a34489ee2f 100644 --- a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java @@ -97,6 +97,10 @@ public class ContextMenuLayer extends OsmandMapLayer { mAddGpxPointBottomSheetHelper = new AddGpxPointBottomSheetHelper(activity, this); } + public void setSelectedObjectContextMenuProvider(IContextMenuProvider provider) { + this.selectedObjectContextMenuProvider = provider; + } + public AddGpxPointBottomSheetHelper getAddGpxPointBottomSheetHelper() { return mAddGpxPointBottomSheetHelper; }