Set screen view detached

This commit is contained in:
Victor Shcherb 2020-09-10 11:57:11 +02:00
parent c914e18fc1
commit d62a92b5e8
3 changed files with 9 additions and 9 deletions

View file

@ -232,7 +232,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc
switchToRoutePlanningMode(); switchToRoutePlanningMode();
} }
// When location is changed we need to refresh map in order to show movement! // When location is changed we need to refresh map in order to show movement!
if (!mapView.isServerRendering()){ if (!mapView.isScreenViewDetached()){
mapView.refreshMap(); mapView.refreshMap();
} }
} }

View file

@ -26,7 +26,7 @@ public class OsmAndHttpServer extends NanoHTTPD {
@Override @Override
public void stop() { public void stop() {
mapActivity.getMapView().setServerRendering(false); mapActivity.getMapView().setScreenViewDetached(false);
super.stop(); super.stop();
} }
@ -46,7 +46,7 @@ public class OsmAndHttpServer extends NanoHTTPD {
this.mapActivity = mapActivity; this.mapActivity = mapActivity;
registerEndpoints(); registerEndpoints();
start(NanoHTTPD.SOCKET_READ_TIMEOUT, false); start(NanoHTTPD.SOCKET_READ_TIMEOUT, false);
mapActivity.getMapView().setServerRendering(true); mapActivity.getMapView().setScreenViewDetached(true);
} }
public String getUrl() { public String getUrl() {

View file

@ -77,7 +77,7 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
protected OsmandSettings settings = null; protected OsmandSettings settings = null;
private CanvasColors canvasColors = null; private CanvasColors canvasColors = null;
private Boolean nightMode = null; private Boolean nightMode = null;
private boolean isServerRendering = false; private boolean isScreenViewDetached = false;
private class CanvasColors { private class CanvasColors {
int colorDay = MAP_DEFAULT_COLOR; int colorDay = MAP_DEFAULT_COLOR;
@ -284,12 +284,12 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
return layers.contains(layer); return layers.contains(layer);
} }
public boolean isServerRendering() { public boolean isScreenViewDetached() {
return isServerRendering; return isScreenViewDetached;
} }
public void setServerRendering(boolean serverRendering) { public void setScreenViewDetached(boolean screenViewDetached) {
isServerRendering = serverRendering; isScreenViewDetached = screenViewDetached;
} }
public float getZorder(OsmandMapLayer layer) { public float getZorder(OsmandMapLayer layer) {
@ -654,7 +654,7 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
final int cx = (int) (ratiox * view.getWidth()); final int cx = (int) (ratiox * view.getWidth());
if ((currentViewport.getPixWidth() != view.getWidth() || currentViewport.getPixHeight() != view.getHeight() || if ((currentViewport.getPixWidth() != view.getWidth() || currentViewport.getPixHeight() != view.getHeight() ||
currentViewport.getCenterPixelY() != cy || currentViewport.getCenterPixelY() != cy ||
currentViewport.getCenterPixelX() != cx) && !isServerRendering) { currentViewport.getCenterPixelX() != cx) && !isScreenViewDetached) {
currentViewport.setPixelDimensions(view.getWidth(), view.getHeight(), ratiox, ratioy); currentViewport.setPixelDimensions(view.getWidth(), view.getHeight(), ratiox, ratioy);
refreshBufferImage(drawSettings); refreshBufferImage(drawSettings);
} }