Hide lanes widget

This commit is contained in:
Alexey Kulish 2016-11-08 08:09:44 +03:00
parent f7aa37a235
commit 3e9fe5c3ae
7 changed files with 12 additions and 9 deletions

View file

@ -778,7 +778,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
} }
//mapContextMenu.setMapZoom(settings.getMapZoomToShow()); //mapContextMenu.setMapZoom(settings.getMapZoomToShow());
mapContextMenu.setMapZoom(tb.getZoom()); mapContextMenu.setMapZoom(tb.getZoom());
if (mapLayers.getMapControlsLayer().getMapRouteInfoMenu().isVisible()) { if (MapRouteInfoMenu.isVisible()) {
mapContextMenu.showMinimized(latLonToShow, mapLabelToShow, toShow); mapContextMenu.showMinimized(latLonToShow, mapLabelToShow, toShow);
mapLayers.getMapControlsLayer().getMapRouteInfoMenu().updateMenu(); mapLayers.getMapControlsLayer().getMapRouteInfoMenu().updateMenu();
mapView.getAnimatedDraggingThread().startMoving(latLonToShow.getLatitude(), mapView.getAnimatedDraggingThread().startMoving(latLonToShow.getLatitude(),

View file

@ -69,6 +69,7 @@ import net.osmand.plus.helpers.MapMarkerDialogHelper.MapMarkersDialogHelperCallb
import net.osmand.plus.helpers.WaypointDialogHelper; import net.osmand.plus.helpers.WaypointDialogHelper;
import net.osmand.plus.helpers.WaypointDialogHelper.WaypointDialogHelperCallbacks; import net.osmand.plus.helpers.WaypointDialogHelper.WaypointDialogHelperCallbacks;
import net.osmand.plus.helpers.WaypointHelper.LocationPointWrapper; import net.osmand.plus.helpers.WaypointHelper.LocationPointWrapper;
import net.osmand.plus.mapcontextmenu.other.MapRouteInfoMenu;
import net.osmand.plus.mapcontextmenu.other.RoutePreferencesMenu; import net.osmand.plus.mapcontextmenu.other.RoutePreferencesMenu;
import net.osmand.plus.mapcontextmenu.other.RoutePreferencesMenu.LocalRoutingParameter; import net.osmand.plus.mapcontextmenu.other.RoutePreferencesMenu.LocalRoutingParameter;
import net.osmand.plus.rastermaps.OsmandRasterMapsPlugin; import net.osmand.plus.rastermaps.OsmandRasterMapsPlugin;
@ -841,7 +842,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
mapActivity.getMapViewTrackingUtilities().setDashboard(null); mapActivity.getMapViewTrackingUtilities().setDashboard(null);
hide(dashboardView.findViewById(R.id.animateContent), animation); hide(dashboardView.findViewById(R.id.animateContent), animation);
if (!mapActivity.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu().isVisible()) { if (!MapRouteInfoMenu.isVisible()) {
AndroidUiHelper.updateVisibility(mapActivity.findViewById(R.id.map_route_land_left_margin_external), false); AndroidUiHelper.updateVisibility(mapActivity.findViewById(R.id.map_route_land_left_margin_external), false);
mapActivity.getMapView().setMapPositionX(0); mapActivity.getMapView().setMapPositionX(0);
mapActivity.getMapView().refreshMap(); mapActivity.getMapView().refreshMap();

View file

@ -71,7 +71,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
private boolean selectFromMapForTarget; private boolean selectFromMapForTarget;
private boolean showMenu = false; private boolean showMenu = false;
private boolean visible; private static boolean visible;
private MapActivity mapActivity; private MapActivity mapActivity;
private MapControlsLayer mapControlsLayer; private MapControlsLayer mapControlsLayer;
public static final String TARGET_SELECT = "TARGET_SELECT"; public static final String TARGET_SELECT = "TARGET_SELECT";
@ -510,7 +510,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
return directionInfo; return directionInfo;
} }
public boolean isVisible() { public static boolean isVisible() {
return visible; return visible;
} }

View file

@ -623,7 +623,7 @@ public class MapControlsLayer extends OsmandMapLayer {
routePlanningMode = true; routePlanningMode = true;
} }
boolean routeFollowingMode = !routePlanningMode && rh.isFollowingMode(); boolean routeFollowingMode = !routePlanningMode && rh.isFollowingMode();
boolean dialogOpened = mapRouteInfoMenu.isVisible(); boolean dialogOpened = MapRouteInfoMenu.isVisible();
boolean showRouteCalculationControls = routePlanningMode || boolean showRouteCalculationControls = routePlanningMode ||
((app.accessibilityEnabled() || (System.currentTimeMillis() - touchEvent < TIMEOUT_TO_SHOW_BUTTONS)) && routeFollowingMode); ((app.accessibilityEnabled() || (System.currentTimeMillis() - touchEvent < TIMEOUT_TO_SHOW_BUTTONS)) && routeFollowingMode);
updateMyLocation(rh, dialogOpened); updateMyLocation(rh, dialogOpened);

View file

@ -562,8 +562,7 @@ public class MapInfoWidgetsFactory {
} }
} else { } else {
int di = MapRouteInfoMenu.getDirectionInfo(); int di = MapRouteInfoMenu.getDirectionInfo();
MapRouteInfoMenu routeInfoMenu = map.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu(); if (di >= 0 && MapRouteInfoMenu.isVisible() &&
if (di >= 0 && routeInfoMenu != null && routeInfoMenu.isVisible() &&
di < routingHelper.getRouteDirections().size()) { di < routingHelper.getRouteDirections().size()) {
showNextTurn = true; showNextTurn = true;
RouteDirectionInfo next = routingHelper.getRouteDirections().get(di); RouteDirectionInfo next = routingHelper.getRouteDirections().get(di);

View file

@ -18,6 +18,7 @@ import net.osmand.plus.dashboard.DashLocationFragment;
import net.osmand.plus.dashboard.DashboardOnMap; import net.osmand.plus.dashboard.DashboardOnMap;
import net.osmand.plus.helpers.AndroidUiHelper; import net.osmand.plus.helpers.AndroidUiHelper;
import net.osmand.plus.helpers.MapMarkerDialogHelper; import net.osmand.plus.helpers.MapMarkerDialogHelper;
import net.osmand.plus.mapcontextmenu.other.MapRouteInfoMenu;
import net.osmand.plus.views.AnimateDraggingMapThread; import net.osmand.plus.views.AnimateDraggingMapThread;
import net.osmand.plus.views.DirectionDrawable; import net.osmand.plus.views.DirectionDrawable;
import net.osmand.plus.views.OsmandMapLayer.DrawSettings; import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
@ -199,7 +200,7 @@ public class MapMarkersWidgetsFactory {
|| !map.getMyApplication().getSettings().MAP_MARKERS_MODE.get().isToolbar() || !map.getMyApplication().getSettings().MAP_MARKERS_MODE.get().isToolbar()
|| map.getMyApplication().getRoutingHelper().isFollowingMode() || map.getMyApplication().getRoutingHelper().isFollowingMode()
|| map.getMyApplication().getRoutingHelper().isRoutePlanningMode() || map.getMyApplication().getRoutingHelper().isRoutePlanningMode()
|| map.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu().isVisible() || MapRouteInfoMenu.isVisible()
|| addressTopBar.getVisibility() == View.VISIBLE || addressTopBar.getVisibility() == View.VISIBLE
|| map.isTopToolbarActive()) { || map.isTopToolbarActive()) {
updateVisibility(false); updateVisibility(false);

View file

@ -816,13 +816,15 @@ public class RouteInfoWidgetsFactory {
} }
} else { } else {
int di = MapRouteInfoMenu.getDirectionInfo(); int di = MapRouteInfoMenu.getDirectionInfo();
if (di >= 0 && MapRouteInfoMenu.isControlVisible() if (di >= 0 && MapRouteInfoMenu.isVisible()
&& di < rh.getRouteDirections().size()) { && di < rh.getRouteDirections().size()) {
RouteDirectionInfo next = rh.getRouteDirections().get(di); RouteDirectionInfo next = rh.getRouteDirections().get(di);
if (next != null) { if (next != null) {
loclanes = next.getTurnType().getLanes(); loclanes = next.getTurnType().getLanes();
// primary = next.getTurnType(); // primary = next.getTurnType();
} }
} else {
loclanes = null;
} }
} }
} }