Replace LF and CRLF. Add warning about internet connection when online rouing is using
This commit is contained in:
parent
1dc78bb32a
commit
afd3fde12e
9 changed files with 622 additions and 614 deletions
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<resources>
|
||||
<string name="internet_connection_required_for_online_route">You are about to use online routing but you do not have internet connection. You can try experimental offline routing (switch in settings).</string>
|
||||
<string name="tts_language_not_supported_title">Language unsupported</string>
|
||||
<string name="tts_language_not_supported">The selected language is not supported by the installed TTS engine. Do you want to go to market and search for other TTS engine? Else preset TTS language will be used.</string>
|
||||
<string name="tts_missing_language_data_title">Missing data</string>
|
||||
|
|
|
@ -411,8 +411,9 @@ public class OsmandSettings {
|
|||
|
||||
|
||||
// this value string is synchronized with settings_pref.xml preference name
|
||||
// make cloudmade by default why osmand is not stable enough
|
||||
public final OsmandPreference<RouteService> ROUTER_SERVICE =
|
||||
new EnumIntPreference<RouteService>("router_service", RouteService.OSMAND, false, RouteService.values());
|
||||
new EnumIntPreference<RouteService>("router_service", RouteService.CLOUDMADE, false, RouteService.values());
|
||||
|
||||
|
||||
// this value string is synchronized with settings_pref.xml preference name
|
||||
|
|
|
@ -446,6 +446,9 @@ public class RoutingHelper {
|
|||
currentRunningJob = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(service != RouteService.OSMAND && !settings.isInternetConnectionAvailable()){
|
||||
showMessage(context.getString(R.string.internet_connection_required_for_online_route), Toast.LENGTH_LONG);
|
||||
}
|
||||
RouteCalculationResult res = provider.calculateRouteImpl(start, end, mode, service, context, currentGPXRoute, fastRouteMode);
|
||||
synchronized (RoutingHelper.this) {
|
||||
if (res.isCalculated()) {
|
||||
|
@ -492,18 +495,21 @@ public class RoutingHelper {
|
|||
return currentRunningJob != null;
|
||||
}
|
||||
|
||||
private void showMessage(final String msg){
|
||||
private void showMessage(final String msg, final int length){
|
||||
if (uiActivity != null) {
|
||||
uiActivity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(uiActivity != null){
|
||||
Toast.makeText(uiActivity, msg, Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(uiActivity, msg, length).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
private void showMessage(final String msg){
|
||||
showMessage(msg, Toast.LENGTH_SHORT);
|
||||
}
|
||||
|
||||
public boolean hasPointsToShow(){
|
||||
return finalLocation != null && !routeNodes.isEmpty();
|
||||
|
|
Loading…
Reference in a new issue