Update provider in layer after adding point
This commit is contained in:
parent
b904e2d205
commit
6169630188
2 changed files with 10 additions and 6 deletions
|
@ -399,12 +399,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
|
||||||
fragmentRef.get().rebuildMenu(centerMarker);
|
fragmentRef.get().rebuildMenu(centerMarker);
|
||||||
}
|
}
|
||||||
ContextMenuLayer contextMenuLayer = mapActivity.getMapLayers().getContextMenuLayer();
|
ContextMenuLayer contextMenuLayer = mapActivity.getMapLayers().getContextMenuLayer();
|
||||||
for (OsmandMapLayer layer : mapActivity.getMapView().getLayers()) {
|
contextMenuLayer.updateContextMenu();
|
||||||
if (layer instanceof ContextMenuLayer.IMoveObjectProvider && ((ContextMenuLayer.IMoveObjectProvider) layer).isObjectMovable(object)) {
|
|
||||||
contextMenuLayer.setSelectedObjectContextMenuProvider((ContextMenuLayer.IContextMenuProvider) layer);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
centerMarker = false;
|
centerMarker = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -232,6 +232,15 @@ public class ContextMenuLayer extends OsmandMapLayer {
|
||||||
this.selectOnMap = selectOnMap;
|
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
|
@Override
|
||||||
public void populateObjectContextMenu(LatLon latLon, Object o, ContextMenuAdapter adapter, MapActivity mapActivity) {
|
public void populateObjectContextMenu(LatLon latLon, Object o, ContextMenuAdapter adapter, MapActivity mapActivity) {
|
||||||
if (menu.hasHiddenBottomInfo()) {
|
if (menu.hasHiddenBottomInfo()) {
|
||||||
|
|
Loading…
Reference in a new issue