From f17358c40577fe54ebd0640388777ab85a4952c8 Mon Sep 17 00:00:00 2001 From: madwasp79 Date: Thu, 14 Mar 2019 17:04:22 +0200 Subject: [PATCH] Issue #6187 - Tracks - Show on map button re-opens wrong sub-folder (cherry picked from commit 0d13a314a3c4e4e6d0c9bcb87f1a01a618f98f5b) --- OsmAnd/src/net/osmand/plus/views/GPXLayer.java | 12 ++++++++---- gradle.properties | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/GPXLayer.java b/OsmAnd/src/net/osmand/plus/views/GPXLayer.java index 2f532636be..626400cab9 100644 --- a/OsmAnd/src/net/osmand/plus/views/GPXLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/GPXLayer.java @@ -100,7 +100,7 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex private Paint paintTextIcon; private OsmandRenderer osmandRenderer; - private int hsh; + private GPXFile gpx; private ContextMenuLayer contextMenuLayer; @@ -111,12 +111,17 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex @ColorInt private int grayColor; + private CommonPreference currentTrackColorPref; + private CommonPreference currentTrackWidthPref; + @Override public void initLayer(OsmandMapTileView view) { this.view = view; selectedGpxHelper = view.getApplication().getSelectedGpxHelper(); mapMarkersHelper = view.getApplication().getMapMarkersHelper(); osmandRenderer = view.getApplication().getResourceManager().getRenderer().getRenderer(); + currentTrackColorPref = view.getSettings().getCustomRenderProperty(CURRENT_TRACK_COLOR_ATTR); + currentTrackWidthPref = view.getSettings().getCustomRenderProperty(CURRENT_TRACK_WIDTH_ATTR); initUI(); } @@ -217,9 +222,8 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex private int updatePaints(int color, boolean routePoints, boolean currentTrack, DrawSettings nightMode, RotatedTileBox tileBox) { RenderingRulesStorage rrs = view.getApplication().getRendererRegistry().getCurrentSelectedRenderer(); final boolean isNight = nightMode != null && nightMode.isNightMode(); - hsh = calculateHash(rrs, routePoints, isNight, tileBox.getMapDensity(), tileBox.getZoom(), - view.getSettings().getCustomRenderProperty(CURRENT_TRACK_COLOR_ATTR).get(), - view.getSettings().getCustomRenderProperty(CURRENT_TRACK_WIDTH_ATTR).get()); + int hsh = calculateHash(rrs, routePoints, isNight, tileBox.getMapDensity(), tileBox.getZoom(), + currentTrackColorPref.get(), currentTrackWidthPref.get()); if (hsh != cachedHash) { cachedHash = hsh; cachedColor = ContextCompat.getColor(view.getApplication(), R.color.gpx_track); diff --git a/gradle.properties b/gradle.properties index 5230a4c9b3..3bb8ab935d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. # Default value: -Xmx10248m -XX:MaxPermSize=256m - org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 # # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit