From ca72d8f5d6b3781ceb4f52765e16681802240eee Mon Sep 17 00:00:00 2001 From: nazar-kutz Date: Tue, 9 Mar 2021 15:38:11 +0200 Subject: [PATCH] Fix "Double zoom in / out visibility" --- .../plus/views/layers/MapControlsLayer.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/layers/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/layers/MapControlsLayer.java index 840599720e..ed425c0993 100644 --- a/OsmAnd/src/net/osmand/plus/views/layers/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/layers/MapControlsLayer.java @@ -876,10 +876,13 @@ public class MapControlsLayer extends OsmandMapLayer { routePlanningBtn.updateVisibility(showBottomMenuButtons); menuControl.updateVisibility(showBottomMenuButtons); + boolean additionalDialogsHide = !isInGpxApproximationMode() + && !isInTrackAppearanceMode() + && !isInChoosingRoutesMode() + && !isInWaypointsChoosingMode(); boolean showZoomButtons = !routeDialogOpened && !shouldHideTopControls && !isInFollowTrackMode() - && (!isInGpxApproximationMode() || !isInTrackAppearanceMode() - || !isInChoosingRoutesMode() || !isInWaypointsChoosingMode() || !portrait); + && (additionalDialogsHide || !portrait); mapZoomIn.updateVisibility(showZoomButtons); mapZoomOut.updateVisibility(showZoomButtons); @@ -1021,9 +1024,14 @@ public class MapControlsLayer extends OsmandMapLayer { public void updateMyLocationVisibility(MapHudButton backToLocationControl, RoutingHelper rh, boolean dialogOpened) { boolean tracked = mapActivity.getMapViewTrackingUtilities().isMapLinkedToLocation(); - boolean visible = !(tracked && rh.isFollowingMode()) && (!isInGpxApproximationMode() || !isPotrait()); + boolean visible = !(tracked && rh.isFollowingMode()); + boolean additionalDialogsHide = !isInTrackAppearanceMode() + && !isInGpxApproximationMode() + && !isInChoosingRoutesMode() + && !isInWaypointsChoosingMode() + && !isInFollowTrackMode(); backToLocationControl.updateVisibility(visible && !dialogOpened && !isInPlanRouteMode() - && (!isInTrackAppearanceMode() || !isInChoosingRoutesMode() || !isInWaypointsChoosingMode() || !isInFollowTrackMode() || !isPotrait())); + && (additionalDialogsHide || !isPotrait())); } public boolean onSingleTap(PointF point, RotatedTileBox tileBox) {