Merge pull request #4554 from osmandapp/move_favourite

Fix #3753
This commit is contained in:
Alexey 2017-10-09 13:29:32 +03:00 committed by GitHub
commit aac0f4b378
2 changed files with 11 additions and 0 deletions

View file

@ -398,6 +398,8 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
if (fragmentRef != null) {
fragmentRef.get().rebuildMenu(centerMarker);
}
ContextMenuLayer contextMenuLayer = mapActivity.getMapLayers().getContextMenuLayer();
contextMenuLayer.updateContextMenu();
centerMarker = false;
}

View file

@ -228,6 +228,15 @@ public class ContextMenuLayer extends OsmandMapLayer {
this.selectOnMap = selectOnMap;
}
public void updateContextMenu() {
for (OsmandMapLayer layer : view.getLayers()) {
if (layer instanceof ContextMenuLayer.IMoveObjectProvider && ((ContextMenuLayer.IMoveObjectProvider) layer).isObjectMovable(selectedObject)) {
selectedObjectContextMenuProvider = (IContextMenuProvider) layer;
break;
}
}
}
@Override
public void populateObjectContextMenu(LatLon latLon, Object o, ContextMenuAdapter adapter, MapActivity mapActivity) {
if (menu.hasHiddenBottomInfo()) {