From d62a92b5e86f03f171aa1cd1d8d92ab114104322 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 10 Sep 2020 11:57:11 +0200 Subject: [PATCH] Set screen view detached --- .../osmand/plus/base/MapViewTrackingUtilities.java | 2 +- .../src/net/osmand/plus/server/OsmAndHttpServer.java | 4 ++-- .../src/net/osmand/plus/views/OsmandMapTileView.java | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java index 542d125afe..2a8588e916 100644 --- a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java +++ b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java @@ -232,7 +232,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc switchToRoutePlanningMode(); } // When location is changed we need to refresh map in order to show movement! - if (!mapView.isServerRendering()){ + if (!mapView.isScreenViewDetached()){ mapView.refreshMap(); } } diff --git a/OsmAnd/src/net/osmand/plus/server/OsmAndHttpServer.java b/OsmAnd/src/net/osmand/plus/server/OsmAndHttpServer.java index f651c02a95..a8f2021142 100644 --- a/OsmAnd/src/net/osmand/plus/server/OsmAndHttpServer.java +++ b/OsmAnd/src/net/osmand/plus/server/OsmAndHttpServer.java @@ -26,7 +26,7 @@ public class OsmAndHttpServer extends NanoHTTPD { @Override public void stop() { - mapActivity.getMapView().setServerRendering(false); + mapActivity.getMapView().setScreenViewDetached(false); super.stop(); } @@ -46,7 +46,7 @@ public class OsmAndHttpServer extends NanoHTTPD { this.mapActivity = mapActivity; registerEndpoints(); start(NanoHTTPD.SOCKET_READ_TIMEOUT, false); - mapActivity.getMapView().setServerRendering(true); + mapActivity.getMapView().setScreenViewDetached(true); } public String getUrl() { diff --git a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java index 68b069e556..a38e5bbaf1 100644 --- a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java +++ b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java @@ -77,7 +77,7 @@ public class OsmandMapTileView implements IMapDownloaderCallback { protected OsmandSettings settings = null; private CanvasColors canvasColors = null; private Boolean nightMode = null; - private boolean isServerRendering = false; + private boolean isScreenViewDetached = false; private class CanvasColors { int colorDay = MAP_DEFAULT_COLOR; @@ -284,12 +284,12 @@ public class OsmandMapTileView implements IMapDownloaderCallback { return layers.contains(layer); } - public boolean isServerRendering() { - return isServerRendering; + public boolean isScreenViewDetached() { + return isScreenViewDetached; } - public void setServerRendering(boolean serverRendering) { - isServerRendering = serverRendering; + public void setScreenViewDetached(boolean screenViewDetached) { + isScreenViewDetached = screenViewDetached; } public float getZorder(OsmandMapLayer layer) { @@ -654,7 +654,7 @@ public class OsmandMapTileView implements IMapDownloaderCallback { final int cx = (int) (ratiox * view.getWidth()); if ((currentViewport.getPixWidth() != view.getWidth() || currentViewport.getPixHeight() != view.getHeight() || currentViewport.getCenterPixelY() != cy || - currentViewport.getCenterPixelX() != cx) && !isServerRendering) { + currentViewport.getCenterPixelX() != cx) && !isScreenViewDetached) { currentViewport.setPixelDimensions(view.getWidth(), view.getHeight(), ratiox, ratioy); refreshBufferImage(drawSettings); }