Search in sources :

Example 1 with TopToolbarView

use of net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory.TopToolbarView in project Osmand by osmandapp.

the class MapInfoLayer method registerAllControls.

public void registerAllControls() {
    RouteInfoWidgetsFactory ric = new RouteInfoWidgetsFactory();
    MapInfoWidgetsFactory mic = new MapInfoWidgetsFactory();
    MapMarkersWidgetsFactory mwf = map.getMapLayers().getMapMarkersLayer().getWidgetsFactory();
    OsmandApplication app = view.getApplication();
    lanesControl = ric.createLanesControl(map, view);
    streetNameView = new TopTextView(map.getMyApplication(), map);
    updateStreetName(false, calculateTextState());
    topToolbarView = new TopToolbarView(map);
    updateTopToolbar(false);
    alarmControl = ric.createAlarmInfoControl(app, map);
    alarmControl.setVisibility(false);
    rulerControl = ric.createRulerControl(app, map);
    rulerControl.setVisibility(false);
    // register left stack
    registerSideWidget(null, R.drawable.ic_action_compass, R.string.map_widget_compass, "compass", true, 4);
    NextTurnInfoWidget bigInfoControl = ric.createNextInfoControl(map, app, false);
    registerSideWidget(bigInfoControl, R.drawable.ic_action_next_turn, R.string.map_widget_next_turn, "next_turn", true, 5);
    NextTurnInfoWidget smallInfoControl = ric.createNextInfoControl(map, app, true);
    registerSideWidget(smallInfoControl, R.drawable.ic_action_next_turn, R.string.map_widget_next_turn_small, "next_turn_small", true, 6);
    NextTurnInfoWidget nextNextInfoControl = ric.createNextNextInfoControl(map, app, true);
    registerSideWidget(nextNextInfoControl, R.drawable.ic_action_next_turn, R.string.map_widget_next_next_turn, "next_next_turn", true, 7);
    // register right stack
    // priorityOrder: 10s navigation-related, 20s position-related, 30s recording- and other plugin-related, 40s general device information, 50s debugging-purpose
    TextInfoWidget intermediateDist = ric.createIntermediateDistanceControl(map);
    registerSideWidget(intermediateDist, R.drawable.ic_action_intermediate, R.string.map_widget_intermediate_distance, "intermediate_distance", false, 13);
    TextInfoWidget dist = ric.createDistanceControl(map);
    registerSideWidget(dist, R.drawable.ic_action_target, R.string.map_widget_distance, "distance", false, 14);
    TextInfoWidget time = ric.createTimeControl(map);
    registerSideWidget(time, new TimeControlWidgetState(app), "time", false, 15);
    TextInfoWidget marker = mwf.createMapMarkerControl(map, true);
    registerSideWidget(marker, R.drawable.ic_action_flag_dark, R.string.map_marker_1st, "map_marker_1st", false, 16);
    TextInfoWidget bearing = ric.createBearingControl(map);
    registerSideWidget(bearing, new BearingWidgetState(app), "bearing", false, 17);
    TextInfoWidget marker2nd = mwf.createMapMarkerControl(map, false);
    registerSideWidget(marker2nd, R.drawable.ic_action_flag_dark, R.string.map_marker_2nd, "map_marker_2nd", false, 18);
    TextInfoWidget speed = ric.createSpeedControl(map);
    registerSideWidget(speed, R.drawable.ic_action_speed, R.string.map_widget_speed, "speed", false, 20);
    TextInfoWidget maxspeed = ric.createMaxSpeedControl(map);
    registerSideWidget(maxspeed, R.drawable.ic_action_speed_limit, R.string.map_widget_max_speed, "max_speed", false, 21);
    TextInfoWidget alt = mic.createAltitudeControl(map);
    registerSideWidget(alt, R.drawable.ic_action_altitude, R.string.map_widget_altitude, "altitude", false, 23);
    TextInfoWidget gpsInfo = mic.createGPSInfoControl(map);
    registerSideWidget(gpsInfo, R.drawable.ic_action_gps_info, R.string.map_widget_gps_info, "gps_info", false, 28);
    TextInfoWidget plainTime = ric.createPlainTimeControl(map);
    registerSideWidget(plainTime, R.drawable.ic_action_time, R.string.map_widget_plain_time, "plain_time", false, 41);
    TextInfoWidget battery = ric.createBatteryControl(map);
    registerSideWidget(battery, R.drawable.ic_action_battery, R.string.map_widget_battery, "battery", false, 42);
    TextInfoWidget ruler = mic.createRulerControl(map);
    registerSideWidget(ruler, R.drawable.ic_action_ruler_circle, R.string.map_widget_ruler_control, "ruler", false, 43);
}
Also used : MapMarkersWidgetsFactory(net.osmand.plus.views.mapwidgets.MapMarkersWidgetsFactory) TextInfoWidget(net.osmand.plus.views.mapwidgets.TextInfoWidget) TimeControlWidgetState(net.osmand.plus.views.mapwidgets.RouteInfoWidgetsFactory.TimeControlWidgetState) OsmandApplication(net.osmand.plus.OsmandApplication) MapInfoWidgetsFactory(net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory) BearingWidgetState(net.osmand.plus.views.mapwidgets.RouteInfoWidgetsFactory.BearingWidgetState) RouteInfoWidgetsFactory(net.osmand.plus.views.mapwidgets.RouteInfoWidgetsFactory) TopTextView(net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory.TopTextView) TopToolbarView(net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory.TopToolbarView) NextTurnInfoWidget(net.osmand.plus.views.mapwidgets.NextTurnInfoWidget)

Aggregations

OsmandApplication (net.osmand.plus.OsmandApplication)1 MapInfoWidgetsFactory (net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory)1 TopTextView (net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory.TopTextView)1 TopToolbarView (net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory.TopToolbarView)1 MapMarkersWidgetsFactory (net.osmand.plus.views.mapwidgets.MapMarkersWidgetsFactory)1 NextTurnInfoWidget (net.osmand.plus.views.mapwidgets.NextTurnInfoWidget)1 RouteInfoWidgetsFactory (net.osmand.plus.views.mapwidgets.RouteInfoWidgetsFactory)1 BearingWidgetState (net.osmand.plus.views.mapwidgets.RouteInfoWidgetsFactory.BearingWidgetState)1 TimeControlWidgetState (net.osmand.plus.views.mapwidgets.RouteInfoWidgetsFactory.TimeControlWidgetState)1 TextInfoWidget (net.osmand.plus.views.mapwidgets.TextInfoWidget)1