Search in sources :

Example 1 with MapMultiSelectionMenu

use of net.osmand.plus.mapcontextmenu.other.MapMultiSelectionMenu in project Osmand by osmandapp.

the class MapContextMenu method setMapActivity.

public void setMapActivity(MapActivity mapActivity) {
    this.mapActivity = mapActivity;
    settings = mapActivity.getMyApplication().getSettings();
    if (!appModeListenerAdded) {
        mapActivity.getMyApplication().getSettings().APPLICATION_MODE.addListener(this);
        appModeListenerAdded = true;
    }
    if (mapMultiSelectionMenu == null) {
        mapMultiSelectionMenu = new MapMultiSelectionMenu(mapActivity);
    } else {
        mapMultiSelectionMenu.setMapActivity(mapActivity);
    }
    if (favoritePointEditor != null) {
        favoritePointEditor.setMapActivity(mapActivity);
    }
    if (wptPtEditor != null) {
        wptPtEditor.setMapActivity(mapActivity);
    }
    if (rtePtEditor != null) {
        rtePtEditor.setMapActivity(mapActivity);
    }
    if (active) {
        acquireMenuController(false);
        if (menuController != null) {
            menuController.addPlainMenuItems(typeStr, this.pointDescription, this.latLon);
        }
        if (searchDoneAction != null && searchDoneAction.dlg != null && searchDoneAction.dlg.getOwnerActivity() != mapActivity) {
            searchDoneAction.dlg = buildSearchActionDialog();
            searchDoneAction.dlg.show();
        }
    } else {
        menuController = null;
    }
}
Also used : MapMultiSelectionMenu(net.osmand.plus.mapcontextmenu.other.MapMultiSelectionMenu)

Example 2 with MapMultiSelectionMenu

use of net.osmand.plus.mapcontextmenu.other.MapMultiSelectionMenu in project Osmand by osmandapp.

the class DownloadedRegionsLayer method collectObjectsFromPoint.

// IContextMenuProvider
@Override
public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List<Object> objects, boolean unknownLocation) {
    boolean isMenuVisible = false;
    if (view.getContext() instanceof MapActivity) {
        MapActivity mapActivity = (MapActivity) view.getContext();
        MapContextMenu menu = mapActivity.getContextMenu();
        MapMultiSelectionMenu multiMenu = menu.getMultiSelectionMenu();
        isMenuVisible = menu.isVisible() || multiMenu.isVisible();
    }
    if (!isMenuVisible) {
        getWorldRegionFromPoint(tileBox, point, objects);
    }
}
Also used : MapContextMenu(net.osmand.plus.mapcontextmenu.MapContextMenu) MapMultiSelectionMenu(net.osmand.plus.mapcontextmenu.other.MapMultiSelectionMenu) MapActivity(net.osmand.plus.activities.MapActivity)

Aggregations

MapMultiSelectionMenu (net.osmand.plus.mapcontextmenu.other.MapMultiSelectionMenu)2 MapActivity (net.osmand.plus.activities.MapActivity)1 MapContextMenu (net.osmand.plus.mapcontextmenu.MapContextMenu)1