diff --git a/OsmAnd/src/net/osmand/plus/activities/SavingTrackHelper.java b/OsmAnd/src/net/osmand/plus/activities/SavingTrackHelper.java index 9700e7fbea..5521ec55d9 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SavingTrackHelper.java +++ b/OsmAnd/src/net/osmand/plus/activities/SavingTrackHelper.java @@ -58,6 +58,7 @@ public class SavingTrackHelper extends SQLiteOpenHelper { private LatLon lastPoint; private float distance = 0; + private boolean record = false; private SelectedGpxFile currentTrack; public SavingTrackHelper(OsmandApplication ctx){ @@ -312,7 +313,7 @@ public class SavingTrackHelper extends SQLiteOpenHelper { // use because there is a bug on some devices with location.getTime() long locationTime = System.currentTimeMillis(); OsmandSettings settings = ctx.getSettings(); - boolean record = false; + //boolean record = false; if(OsmAndLocationProvider.isPointAccurateForRouting(location) && OsmAndLocationProvider.isNotSimulatedLocation(location) ) { if (OsmandPlugin.getEnabledPlugin(OsmandMonitoringPlugin.class) != null) { @@ -391,6 +392,10 @@ public class SavingTrackHelper extends SQLiteOpenHelper { } } + public boolean getRecord() { + return record; + } + public float getDistance() { return distance; } diff --git a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java index 3e5dc3d3ff..15f7a58ee7 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java @@ -170,8 +170,9 @@ public class OsmandMonitoringPlugin extends OsmandPlugin implements MonitoringIn Drawable d = monitoringInactive; long last = lastUpdateTime; final boolean globalRecord = settings.SAVE_GLOBAL_TRACK_TO_GPX.get(); - //if (globalRecord || settings.SAVE_TRACK_TO_GPX.get()) { - float dist = app.getSavingTrackHelper().getDistance(); + final boolean record = app.getSavingTrackHelper().getRecord(); + float dist = app.getSavingTrackHelper().getDistance(); + //make sure widget always shows recorded track distance if unsaved track exists if (dist > 0) { last = app.getSavingTrackHelper().getLastTimeUpdated(); @@ -184,16 +185,17 @@ public class OsmandMonitoringPlugin extends OsmandPlugin implements MonitoringIn subtxt = ds.substring(ls + 1); } } - if(globalRecord) { - //indicates global recording (+background recording) - d = monitoringBig; - } else if (settings.SAVE_TRACK_TO_GPX.get()) { - //indicates (profile-based, configured in settings) screen-on recording - d = monitoringSmall; - } else { - d = monitoringInactive; - } - //} + + if(globalRecord) { + //indicates global recording (+background recording) + d = monitoringBig; + } else if (record) { + //indicates (profile-based, configured in settings) recording (looks like is only active during nav in follow mode) + d = monitoringSmall; + } else { + d = monitoringInactive; + } + setText(txt, subtxt); setImageDrawable(d); if (last != lastUpdateTime && globalRecord) {