From 1d3849ef4dd10460ab3ede13536b977ca9522f54 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 10 Sep 2020 16:54:38 +0300 Subject: [PATCH] time checks --- OsmAnd/res/layout/server_fragment.xml | 4 +++- OsmAnd/src/net/osmand/plus/server/ServerFragment.java | 4 +++- .../src/net/osmand/plus/server/endpoints/TileEndpoint.java | 6 +++++- OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/OsmAnd/res/layout/server_fragment.xml b/OsmAnd/res/layout/server_fragment.xml index 35f9a16fe9..816a3cf5d5 100644 --- a/OsmAnd/res/layout/server_fragment.xml +++ b/OsmAnd/res/layout/server_fragment.xml @@ -5,7 +5,9 @@ android:orientation="vertical" android:padding="32dp" android:gravity="center" - android:background="@color/color_black"> + android:clickable="true" + android:background="@color/color_black" + android:focusable="true"> = 0) { url = url.substring(0, extInd); @@ -75,6 +77,7 @@ public class TileEndpoint implements OsmAndHttpServer.ApiEndpoint { } private synchronized MetaTileFileSystemCache.MetaTileCache requestMetatile(int x, int y, int zoom) { + long time2 = System.currentTimeMillis(); MetaTileFileSystemCache.MetaTileCache cacheTile = this.cache.get(zoom, x, y); if (cacheTile != null) { return cacheTile; @@ -102,6 +105,7 @@ public class TileEndpoint implements OsmAndHttpServer.ApiEndpoint { } res.bmp = tempBmp.copy(tempBmp.getConfig(), true); this.cache.put(res); + LOG.debug("SERVER: TIME TO REQUEST TILE: " + (System.currentTimeMillis() - time2)); return res; } catch (InterruptedException e) { LOG.error(e); diff --git a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java index a38e5bbaf1..f3d6660e6b 100644 --- a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java +++ b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java @@ -830,7 +830,7 @@ public class OsmandMapTileView implements IMapDownloaderCallback { // this method could be called in non UI thread public void refreshMap(final boolean updateVectorRendering) { - if (view != null && view.isShown()) { + if ((view != null && view.isShown()) || isScreenViewDetached) { boolean nightMode = application.getDaynightHelper().isNightMode(); Boolean currentNightMode = this.nightMode; boolean forceUpdateVectorDrawing = currentNightMode != null && currentNightMode != nightMode;