diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 0e25a6bfeb..fa4a1f1635 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -1190,9 +1190,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven } public void readLocationToShow() { - if (!getDashboard().isVisible()) { - mapLayers.getMapControlsLayer().showMapControlsIfHidden(); - } + showMapControls(); LatLon cur = new LatLon(mapView.getLatitude(), mapView.getLongitude()); LatLon latLonToShow = settings.getAndClearMapLocationToShow(); @@ -1482,6 +1480,11 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven if (mapLayers.getMapQuickActionLayer() != null) { mapLayers.getMapQuickActionLayer().refreshLayer(); } + MapControlsLayer mapControlsLayer = mapLayers.getMapControlsLayer(); + if (mapControlsLayer != null && (!mapControlsLayer.isMapControlsVisible() || settings.MAP_EMPTY_STATE_ALLOWED.get())) { + showMapControls(); + } + mapLayers.updateLayers(mapView); mapActions.updateDrawerMenu(); mapView.setComplexZoom(mapView.getZoom(), mapView.getSettingsMapDensity()); @@ -1636,6 +1639,12 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven }, 2500); } + public void showMapControls() { + if (!getDashboard().isVisible() && mapLayers.getMapControlsLayer() != null) { + mapLayers.getMapControlsLayer().showMapControlsIfHidden(); + } + } + public OsmandMapTileView getMapView() { return mapView; } diff --git a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java index 7486f6a9eb..ff05b24ae3 100644 --- a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java @@ -974,8 +974,11 @@ public class ContextMenuLayer extends OsmandMapLayer { } } } - if (!processed && activity.getMyApplication().getSettings().MAP_EMPTY_STATE_ALLOWED.get()) { - activity.getMapLayers().getMapControlsLayer().switchMapControlsVisibility(true); + if (!processed) { + MapControlsLayer mapControlsLayer = activity.getMapLayers().getMapControlsLayer(); + if (!mapControlsLayer.isMapControlsVisible() || activity.getMyApplication().getSettings().MAP_EMPTY_STATE_ALLOWED.get()) { + mapControlsLayer.switchMapControlsVisibility(true); + } } return false; }