This commit is contained in:
Arndt Brenschede 2016-08-30 19:30:53 +02:00
parent ea572ad47f
commit e217f12e71
19 changed files with 58 additions and 27 deletions

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="14"
android:versionName="1.4.3" package="btools.routingapp">
android:versionCode="15"
android:versionName="1.4.4" package="btools.routingapp">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".BRouterActivity"
android:label="@string/app_name"

View file

@ -5,7 +5,7 @@
<parent>
<groupId>org.btools</groupId>
<artifactId>brouter</artifactId>
<version>1.4.3</version>
<version>1.4.4</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>brouter-routing-app</artifactId>

View file

@ -38,6 +38,7 @@ public class BRouterActivity extends Activity implements OnInitListener
private static final int DIALOG_OLDDATAHINT_ID = 13;
private static final int DIALOG_SHOW_WP_HELP_ID = 14;
private static final int DIALOG_SHOW_WP_SCANRESULT_ID = 15;
private static final int DIALOG_SHOW_REPEAT_TIMEOUT_HELP_ID = 16;
private BRouterView mBRouterView;
private PowerManager mPowerManager;
@ -145,6 +146,22 @@ public class BRouterActivity extends Activity implements OnInitListener
}
} );
return builder.create();
case DIALOG_SHOW_REPEAT_TIMEOUT_HELP_ID:
builder = new AlertDialog.Builder( this );
builder
.setTitle( "Successfully prepared a timeout-free calculation" )
.setMessage(
"You successfully repeated a calculation that previously run into a timeout "
+ "when started from your map-tool. If you repeat the same request from your "
+ "maptool, with the exact same destination point and a close-by starting point, "
+ "this request is guaranteed not to time out." ).setNegativeButton( "Exit", new DialogInterface.OnClickListener()
{
public void onClick( DialogInterface dialog, int id )
{
finish();
}
} );
return builder.create();
case DIALOG_SHOW_WP_SCANRESULT_ID:
builder = new AlertDialog.Builder( this );
builder
@ -304,8 +321,8 @@ public class BRouterActivity extends Activity implements OnInitListener
} );
return builder.create();
case DIALOG_SHOWRESULT_ID:
String leftLabel = wpCount < 0 ? ( wpCount == -1 ? "Exit" : "Help") : ( wpCount == 0 ? "Select from" : "Select to/via" );
String rightLabel = wpCount < 2 ? "Server-Mode" : "Calc Route";
String leftLabel = wpCount < 0 ? ( wpCount != -2 ? "Exit" : "Help") : ( wpCount == 0 ? "Select from" : "Select to/via" );
String rightLabel = wpCount < 2 ? ( wpCount == -3 ? "Help" : "Server-Mode" ) : "Calc Route";
builder = new AlertDialog.Builder( this );
builder.setTitle( title ).setMessage( errorMessage ).setPositiveButton( leftLabel, new DialogInterface.OnClickListener()
{
@ -328,8 +345,14 @@ public class BRouterActivity extends Activity implements OnInitListener
{
public void onClick( DialogInterface dialog, int id )
{
if ( wpCount < 2 )
if ( wpCount == -3 )
{
showRepeatTimeoutHelp();
}
else if ( wpCount < 2 )
{
mBRouterView.startConfigureService();
}
else
{
mBRouterView.finishWaypointSelection();
@ -504,6 +527,12 @@ public class BRouterActivity extends Activity implements OnInitListener
showNewDialog( DIALOG_SHOW_WP_HELP_ID );
}
@SuppressWarnings("deprecation")
public void showRepeatTimeoutHelp()
{
showNewDialog( DIALOG_SHOW_REPEAT_TIMEOUT_HELP_ID );
}
@SuppressWarnings("deprecation")
public void showWpDatabaseScanSuccess( String bestGuess )
{

View file

@ -168,7 +168,7 @@ public class BRouterView extends View
String basedir = fbd.getAbsolutePath();
AppLogger.log( "using basedir: " + basedir );
String version = "v1.4.3";
String version = "v1.4.4";
// create missing directories
assertDirectoryExists( "project directory", basedir + "/brouter", null, null );
@ -748,7 +748,7 @@ public class BRouterView extends View
}
else
{
String result = "version = BRouter-1.4.3\n" + "distance = " + cr.getDistance() / 1000. + " km\n" + "filtered ascend = " + cr.getAscend()
String result = "version = BRouter-1.4.4\n" + "distance = " + cr.getDistance() / 1000. + " km\n" + "filtered ascend = " + cr.getAscend()
+ " m\n" + "plain ascend = " + cr.getPlainAscend();
rawTrack = cr.getFoundRawTrack();
@ -763,7 +763,7 @@ public class BRouterView extends View
if ( cr.getAlternativeIndex() > 0 )
title += " / " + cr.getAlternativeIndex() + ". Alternative";
( (BRouterActivity) getContext() ).showResultMessage( title, result, -1 );
( (BRouterActivity) getContext() ).showResultMessage( title, result, rawTrackPath == null ? -1 : -3 );
cr = null;
waitingForSelection = true;
return;