Merge branch 'master' of ssh://github.com/osmandapp/Osmand
This commit is contained in:
commit
b4b92311c3
4 changed files with 23 additions and 33 deletions
|
@ -1977,4 +1977,8 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz
|
||||||
<string name="int_hour">h</string>
|
<string name="int_hour">h</string>
|
||||||
<string name="duration">Durata</string>
|
<string name="duration">Durata</string>
|
||||||
<string name="distance">Distanza</string>
|
<string name="distance">Distanza</string>
|
||||||
</resources>
|
<string name="save_track_to_gpx_globally">Registra la traccia in un file GPX</string>
|
||||||
|
<string name="save_track_to_gpx_globally_descr">La registrazione della posizione in un file GPX può essere accesa o spenta dal widget registrazione GPX sulla schermata della mappa</string>
|
||||||
|
<string name="save_track_interval_globally">Intervallo registrazione</string>
|
||||||
|
<string name="rendering_attr_publicTransportMode_name">Modo trasporto pubblico</string>
|
||||||
|
</resources>
|
||||||
|
|
|
@ -560,8 +560,9 @@ public class OsmandApplication extends Application {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(getSettings().SAVE_GLOBAL_TRACK_TO_GPX.get()){
|
//I guess we should not start the sleep mode service automatically upon app start
|
||||||
startNavigationService(NavigationService.USED_BY_GPX);
|
//if(getSettings().SAVE_GLOBAL_TRACK_TO_GPX.get()){
|
||||||
|
// startNavigationService(NavigationService.USED_BY_GPX);
|
||||||
}
|
}
|
||||||
// restore backuped favorites to normal file
|
// restore backuped favorites to normal file
|
||||||
final File appDir = getAppPath(null);
|
final File appDir = getAppPath(null);
|
||||||
|
@ -850,18 +851,15 @@ public class OsmandApplication extends Application {
|
||||||
final Intent serviceIntent = new Intent(this, NavigationService.class);
|
final Intent serviceIntent = new Intent(this, NavigationService.class);
|
||||||
serviceIntent.putExtra(NavigationService.USAGE_INTENT, intent);
|
serviceIntent.putExtra(NavigationService.USAGE_INTENT, intent);
|
||||||
if (getNavigationService() == null) {
|
if (getNavigationService() == null) {
|
||||||
if (intent == NavigationService.USED_BY_GPX) {
|
if (intent != NavigationService.USED_BY_GPX) {
|
||||||
if (getSettings().SAVE_GLOBAL_TRACK_INTERVAL.get() < 30000) {
|
//for only-USED_BY_GPX case use pre-configured SERVICE_OFF_INTERVAL
|
||||||
getSettings().SERVICE_OFF_INTERVAL.set(0);
|
//other cases always use "continuous":
|
||||||
} else {
|
|
||||||
//Use SERVICE_OFF_INTERVAL > 0 to conserve power for longer GPX recording intervals
|
|
||||||
getSettings().SERVICE_OFF_INTERVAL.set(getSettings().SAVE_GLOBAL_TRACK_INTERVAL.get());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
getSettings().SERVICE_OFF_INTERVAL.set(0);
|
getSettings().SERVICE_OFF_INTERVAL.set(0);
|
||||||
}
|
}
|
||||||
startService(serviceIntent);
|
startService(serviceIntent);
|
||||||
} else {
|
} else {
|
||||||
|
//additional cases always use "continuous"
|
||||||
|
//TODO: fallback to custom USED_BY_GPX interval in case all other sleep mode purposes have been stopped
|
||||||
getSettings().SERVICE_OFF_INTERVAL.set(0);
|
getSettings().SERVICE_OFF_INTERVAL.set(0);
|
||||||
getNavigationService().addUsageIntent(intent);
|
getNavigationService().addUsageIntent(intent);
|
||||||
}
|
}
|
||||||
|
|
|
@ -476,8 +476,7 @@ public class GeoIntentActivity extends OsmandListActivity {
|
||||||
.replaceAll(" ", ",");
|
.replaceAll(" ", ",");
|
||||||
System.out.println(query);
|
System.out.println(query);
|
||||||
//String is split on each comma
|
//String is split on each comma
|
||||||
String[] s = query.substring(query
|
String[] s = query.split(",");
|
||||||
.indexOf("q=") + 2).split(",");
|
|
||||||
|
|
||||||
elements = new ArrayList<String>();
|
elements = new ArrayList<String>();
|
||||||
for (int i = 0; i<s.length; i++) {
|
for (int i = 0; i<s.length; i++) {
|
||||||
|
|
|
@ -198,11 +198,9 @@ public class OsmandMonitoringPlugin extends OsmandPlugin implements MonitoringIn
|
||||||
|
|
||||||
setText(txt, subtxt);
|
setText(txt, subtxt);
|
||||||
setImageDrawable(d);
|
setImageDrawable(d);
|
||||||
//if ((last != lastUpdateTime) && globalRecord) {
|
|
||||||
if ((last != lastUpdateTime) && (globalRecord || isRecording)) {
|
if ((last != lastUpdateTime) && (globalRecord || isRecording)) {
|
||||||
lastUpdateTime = last;
|
lastUpdateTime = last;
|
||||||
//blink();
|
//blink implementation with 2 indicator states (global logging + profile/navigation logging)
|
||||||
//test blink wuith 2 indicator states
|
|
||||||
setImageDrawable(monitoringInactive);
|
setImageDrawable(monitoringInactive);
|
||||||
invalidate();
|
invalidate();
|
||||||
postDelayed(new Runnable() {
|
postDelayed(new Runnable() {
|
||||||
|
@ -216,23 +214,10 @@ public class OsmandMonitoringPlugin extends OsmandPlugin implements MonitoringIn
|
||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
//end test
|
|
||||||
}
|
}
|
||||||
updateVisibility(visible);
|
updateVisibility(visible);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// private void blink() {
|
|
||||||
// setImageDrawable(monitoringSmall);
|
|
||||||
// invalidate();
|
|
||||||
// postDelayed(new Runnable() {
|
|
||||||
// @Override
|
|
||||||
// public void run() {
|
|
||||||
// setImageDrawable(monitoringBig);
|
|
||||||
// invalidate();
|
|
||||||
// }
|
|
||||||
// }, 500);
|
|
||||||
// }
|
|
||||||
};
|
};
|
||||||
monitoringControl.updateInfo(null);
|
monitoringControl.updateInfo(null);
|
||||||
|
|
||||||
|
@ -345,10 +330,14 @@ public class OsmandMonitoringPlugin extends OsmandPlugin implements MonitoringIn
|
||||||
settings.SAVE_GLOBAL_TRACK_INTERVAL.set(vs.value);
|
settings.SAVE_GLOBAL_TRACK_INTERVAL.set(vs.value);
|
||||||
settings.SAVE_GLOBAL_TRACK_TO_GPX.set(true);
|
settings.SAVE_GLOBAL_TRACK_TO_GPX.set(true);
|
||||||
settings.SAVE_GLOBAL_TRACK_REMEMBER.set(choice.value);
|
settings.SAVE_GLOBAL_TRACK_REMEMBER.set(choice.value);
|
||||||
//interval setting not needed here, handled centrally in app.startNavigationService
|
|
||||||
//if (app.getNavigationService() == null) {
|
if (settings.SAVE_GLOBAL_TRACK_INTERVAL.get() < 30000) {
|
||||||
// settings.SERVICE_OFF_INTERVAL.set(0);
|
settings.SERVICE_OFF_INTERVAL.set(0);
|
||||||
//}
|
} else {
|
||||||
|
//Use SERVICE_OFF_INTERVAL > 0 to conserve power for longer GPX recording intervals
|
||||||
|
settings.SERVICE_OFF_INTERVAL.set(settings.SAVE_GLOBAL_TRACK_INTERVAL.get());
|
||||||
|
}
|
||||||
|
|
||||||
app.startNavigationService(NavigationService.USED_BY_GPX);
|
app.startNavigationService(NavigationService.USED_BY_GPX);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue