diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index 3afdfbdf74..49b665f25a 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -368,7 +368,6 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL fragmentRef.get().centerMarkerLocation(); } } - updateWidgetsVisibility(false); } public void show(@NonNull LatLon latLon, @@ -389,7 +388,6 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL } centerMarker = false; autoHide = false; - updateWidgetsVisibility(false); } public void update(LatLon latLon, PointDescription pointDescription, Object object) { @@ -451,7 +449,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL updateWidgetsVisibility(true); } - private void updateWidgetsVisibility(boolean visible) { + public void updateWidgetsVisibility(boolean visible) { int visibility = visible ? View.VISIBLE : View.GONE; mapActivity.findViewById(R.id.map_center_info).setVisibility(visibility); mapActivity.findViewById(R.id.map_left_widgets_panel).setVisibility(visibility); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java index 3e85f4a5c5..b986fafa12 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java @@ -525,6 +525,7 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents { boolean needMapAdjust = oldMenuState != newMenuState && newMenuState != MenuState.FULL_SCREEN; if (newMenuState != oldMenuState) { + menu.updateWidgetsVisibility(newMenuState != MenuState.HALF_SCREEN); doBeforeMenuStateChange(oldMenuState, newMenuState); } diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java index 2f2eb8a3d2..486534bebb 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java @@ -46,6 +46,7 @@ import net.osmand.plus.activities.MapActivity.ShowQuickSearchMode; import net.osmand.plus.dashboard.DashboardOnMap.DashboardType; import net.osmand.plus.dialogs.DirectionsDialogs; import net.osmand.plus.mapcontextmenu.MapContextMenu; +import net.osmand.plus.mapcontextmenu.MenuController; import net.osmand.plus.mapcontextmenu.other.MapRouteInfoMenu; import net.osmand.plus.mapcontextmenu.other.TrackDetailsMenu; import net.osmand.plus.routing.RoutingHelper; @@ -709,11 +710,12 @@ public class MapControlsLayer extends OsmandMapLayer { boolean routeDialogOpened = MapRouteInfoMenu.isVisible(); boolean trackDialogOpened = TrackDetailsMenu.isVisible(); boolean contextMenuOpened = mapActivity.getContextMenu().isVisible(); + int contextMenuState = mapActivity.getContextMenu().getCurrentMenuState(); boolean showRouteCalculationControls = routePlanningMode || ((app.accessibilityEnabled() || (System.currentTimeMillis() - touchEvent < TIMEOUT_TO_SHOW_BUTTONS)) && routeFollowingMode); - updateMyLocation(rh, routeDialogOpened || trackDialogOpened || contextMenuOpened); + updateMyLocation(rh, routeDialogOpened || trackDialogOpened || (contextMenuOpened && contextMenuState == MenuController.MenuState.HALF_SCREEN)); boolean showButtons = (showRouteCalculationControls || !routeFollowingMode) - && !isInMovingMarkerMode() && !isInGpxDetailsMode() && !isInMeasurementToolMode() && !isInPlanRouteMode() && !contextMenuOpened; + && !isInMovingMarkerMode() && !isInGpxDetailsMode() && !isInMeasurementToolMode() && !isInPlanRouteMode() && (!contextMenuOpened || contextMenuState != MenuController.MenuState.HALF_SCREEN); //routePlanningBtn.setIconResId(routeFollowingMode ? R.drawable.ic_action_gabout_dark : R.drawable.map_directions); if (rh.isFollowingMode()) { routePlanningBtn.setIconResId(R.drawable.map_start_navigation); @@ -728,16 +730,16 @@ public class MapControlsLayer extends OsmandMapLayer { routePlanningBtn.updateVisibility(showButtons); menuControl.updateVisibility(showButtons); - mapZoomIn.updateVisibility(!routeDialogOpened && !contextMenuOpened); - mapZoomOut.updateVisibility(!routeDialogOpened && !contextMenuOpened); + mapZoomIn.updateVisibility(!routeDialogOpened && (!contextMenuOpened || contextMenuState != MenuController.MenuState.HALF_SCREEN)); + mapZoomOut.updateVisibility(!routeDialogOpened && (!contextMenuOpened || contextMenuState != MenuController.MenuState.HALF_SCREEN)); compassHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && shouldShowCompass() - && !isInMeasurementToolMode() && !isInPlanRouteMode() && !contextMenuOpened); + && !isInMeasurementToolMode() && !isInPlanRouteMode() && (!contextMenuOpened || contextMenuState != MenuController.MenuState.HALF_SCREEN)); if (layersHud.setIconResId(settings.getApplicationMode().getMapIconId())) { layersHud.update(app, isNight); } - layersHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && !isInMeasurementToolMode() && !isInPlanRouteMode() && !contextMenuOpened); - quickSearchHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && !isInMeasurementToolMode() && !isInPlanRouteMode() && !contextMenuOpened); + layersHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && !isInMeasurementToolMode() && !isInPlanRouteMode() && (!contextMenuOpened || contextMenuState != MenuController.MenuState.HALF_SCREEN)); + quickSearchHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && !isInMeasurementToolMode() && !isInPlanRouteMode() && (!contextMenuOpened || contextMenuState != MenuController.MenuState.HALF_SCREEN)); if (!routePlanningMode && !routeFollowingMode) { if (mapView.isZooming()) { diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java index 05b85c3296..765a029107 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java @@ -28,6 +28,7 @@ import net.osmand.plus.helpers.AndroidUiHelper; import net.osmand.plus.helpers.WaypointDialogHelper; import net.osmand.plus.helpers.WaypointHelper; import net.osmand.plus.helpers.WaypointHelper.LocationPointWrapper; +import net.osmand.plus.mapcontextmenu.MenuController; import net.osmand.plus.mapcontextmenu.other.MapRouteInfoMenu; import net.osmand.plus.routing.RouteDirectionInfo; import net.osmand.plus.routing.RoutingHelper; @@ -801,7 +802,7 @@ public class MapInfoWidgetsFactory { } } } - if (map.isTopToolbarActive() || map.getContextMenu().isVisible()) { + if (map.isTopToolbarActive() || (map.getContextMenu().isVisible() && map.getContextMenu().getCurrentMenuState() == MenuController.MenuState.HALF_SCREEN)) { updateVisibility(false); } else if (!showNextTurn && updateWaypoint()) { updateVisibility(true); diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java index c8d4602d85..18c3d5ab57 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java @@ -17,6 +17,7 @@ import net.osmand.plus.activities.MapActivity; import net.osmand.plus.dashboard.DashLocationFragment; import net.osmand.plus.dashboard.DashboardOnMap; import net.osmand.plus.helpers.AndroidUiHelper; +import net.osmand.plus.mapcontextmenu.MenuController; import net.osmand.plus.mapcontextmenu.other.MapRouteInfoMenu; import net.osmand.plus.views.AnimateDraggingMapThread; import net.osmand.plus.views.DirectionDrawable; @@ -198,7 +199,7 @@ public class MapMarkersWidgetsFactory { || MapRouteInfoMenu.isVisible() || addressTopBar.getVisibility() == View.VISIBLE || map.isTopToolbarActive() - || map.getContextMenu().isVisible()) { + || (map.getContextMenu().isVisible() && map.getContextMenu().getCurrentMenuState() == MenuController.MenuState.HALF_SCREEN)) { updateVisibility(false); return; }