This commit is contained in:
PavelRatushny 2017-10-09 12:09:24 +03:00
parent 3dfde486ca
commit b904e2d205
2 changed files with 11 additions and 0 deletions

View file

@ -398,6 +398,13 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
if (fragmentRef != null) { if (fragmentRef != null) {
fragmentRef.get().rebuildMenu(centerMarker); 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; centerMarker = false;
} }

View file

@ -97,6 +97,10 @@ public class ContextMenuLayer extends OsmandMapLayer {
mAddGpxPointBottomSheetHelper = new AddGpxPointBottomSheetHelper(activity, this); mAddGpxPointBottomSheetHelper = new AddGpxPointBottomSheetHelper(activity, this);
} }
public void setSelectedObjectContextMenuProvider(IContextMenuProvider provider) {
this.selectedObjectContextMenuProvider = provider;
}
public AddGpxPointBottomSheetHelper getAddGpxPointBottomSheetHelper() { public AddGpxPointBottomSheetHelper getAddGpxPointBottomSheetHelper() {
return mAddGpxPointBottomSheetHelper; return mAddGpxPointBottomSheetHelper;
} }