Search in sources :

Example 16 with MapInfoLayer

use of net.osmand.plus.views.layers.MapInfoLayer in project Osmand by osmandapp.

the class ParkingPositionPlugin method updateLayers.

@Override
public void updateLayers(@NonNull Context context, @Nullable MapActivity mapActivity) {
    if (mapActivity == null) {
        return;
    }
    if (isActive()) {
        if (parkingPlaceControl == null) {
            registerWidget(mapActivity);
        }
    } else {
        MapInfoLayer mapInfoLayer = mapActivity.getMapLayers().getMapInfoLayer();
        if (mapInfoLayer != null && parkingPlaceControl != null) {
            mapInfoLayer.removeSideWidget(parkingPlaceControl);
            mapInfoLayer.recreateControls();
            parkingPlaceControl = null;
        }
    }
}
Also used : MapInfoLayer(net.osmand.plus.views.layers.MapInfoLayer)

Example 17 with MapInfoLayer

use of net.osmand.plus.views.layers.MapInfoLayer in project Osmand by osmandapp.

the class MapActivity method showTopToolbar.

public void showTopToolbar(@NonNull TopToolbarController controller) {
    MapInfoLayer mapInfoLayer = getMapLayers().getMapInfoLayer();
    mapInfoLayer.addTopToolbarController(controller);
    updateStatusBarColor();
}
Also used : MapInfoLayer(net.osmand.plus.views.layers.MapInfoLayer)

Example 18 with MapInfoLayer

use of net.osmand.plus.views.layers.MapInfoLayer in project Osmand by osmandapp.

the class MapActivity method hideTopToolbar.

public void hideTopToolbar(@NonNull TopToolbarController controller) {
    MapInfoLayer mapInfoLayer = getMapLayers().getMapInfoLayer();
    mapInfoLayer.removeTopToolbarController(controller);
    updateStatusBarColor();
}
Also used : MapInfoLayer(net.osmand.plus.views.layers.MapInfoLayer)

Example 19 with MapInfoLayer

use of net.osmand.plus.views.layers.MapInfoLayer in project Osmand by osmandapp.

the class OsmandMonitoringPlugin method registerWidget.

private void registerWidget(@NonNull MapActivity activity) {
    MapInfoLayer layer = activity.getMapLayers().getMapInfoLayer();
    monitoringControl = createMonitoringControl(activity);
    layer.registerSideWidget(monitoringControl, R.drawable.ic_action_play_dark, R.string.map_widget_monitoring, "monitoring", false, 30);
    layer.recreateControls();
}
Also used : MapInfoLayer(net.osmand.plus.views.layers.MapInfoLayer)

Example 20 with MapInfoLayer

use of net.osmand.plus.views.layers.MapInfoLayer in project Osmand by osmandapp.

the class OsmandMonitoringPlugin method updateLayers.

@Override
public void updateLayers(@NonNull Context context, @Nullable MapActivity mapActivity) {
    if (mapActivity != null) {
        if (isActive()) {
            if (monitoringControl == null) {
                registerWidget(mapActivity);
            }
        } else {
            if (monitoringControl != null) {
                MapInfoLayer layer = mapActivity.getMapLayers().getMapInfoLayer();
                layer.removeSideWidget(monitoringControl);
                layer.recreateControls();
                monitoringControl = null;
            }
        }
    }
}
Also used : MapInfoLayer(net.osmand.plus.views.layers.MapInfoLayer)

Aggregations

MapInfoLayer (net.osmand.plus.views.layers.MapInfoLayer)24 OsmandMapTileView (net.osmand.plus.views.OsmandMapTileView)6 View (android.view.View)4 MapActivity (net.osmand.plus.activities.MapActivity)4 TextInfoWidget (net.osmand.plus.views.mapwidgets.widgets.TextInfoWidget)4 ContextMenuItem (net.osmand.plus.ContextMenuItem)3 MapControlsLayer (net.osmand.plus.views.layers.MapControlsLayer)3 BroadcastReceiver (android.content.BroadcastReceiver)2 Context (android.content.Context)2 Intent (android.content.Intent)2 Drawable (android.graphics.drawable.Drawable)2 WeakReference (java.lang.ref.WeakReference)2 OsmandApplication (net.osmand.plus.OsmandApplication)2 ApplicationMode (net.osmand.plus.settings.backend.ApplicationMode)2 MapLayers (net.osmand.plus.views.MapLayers)2 SuppressLint (android.annotation.SuppressLint)1 ColorDrawable (android.graphics.drawable.ColorDrawable)1 MenuItem (android.view.MenuItem)1 AbsListView (android.widget.AbsListView)1 AdapterView (android.widget.AdapterView)1