Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2012-09-07 19:41:12 +02:00
commit ced810107b
4 changed files with 22 additions and 8 deletions

View file

@ -104,15 +104,23 @@ public class OsmAndFormatter {
if (kmh >= 15 || (am == ApplicationMode.CAR)) {
return ((int) kmh) + " " + ctx.getString(R.string.km_h);
}
kmh = ((int) kmh * 10f) / 10f;
return kmh + " " + ctx.getString(R.string.km_h);
int kmh10 = (int) (kmh * 10f);
if (kmh10 % 10 == 0) {
return (kmh10 / 10) + " " + ctx.getString(R.string.km_h);
} else {
return (kmh10 / 10f) + " " + ctx.getString(R.string.km_h);
}
} else {
float mph = kmh * METERS_IN_KILOMETER / METERS_IN_ONE_MILE;
if (mph >= 10) {
return ((int) (mph)) + " " + ctx.getString(R.string.mile_per_hour);
} else {
mph = ((int) mph * 10f) / 10f;
return mph + " " + ctx.getString(R.string.mile_per_hour);
int mph10 = (int) (mph * 10f);
if(mph10 % 10 == 0) {
return (mph10 / 10) + " " + ctx.getString(R.string.mile_per_hour);
} else {
return (mph10 / 10f) + " " + ctx.getString(R.string.mile_per_hour);
}
}
}
}

View file

@ -463,7 +463,10 @@ public class MapActivityActions implements DialogProvider {
return;
}
routingHelper.setAppMode(mode);
// Do not overwrite PREV_APPLICATION_MODE if already navigating
if (!routingHelper.isFollowingMode()) {
settings.PREV_APPLICATION_MODE.set(settings.APPLICATION_MODE.get());
}
settings.FOLLOW_THE_ROUTE.set(false);
settings.FOLLOW_THE_GPX_ROUTE.set(null);
routingHelper.setFollowingMode(false);
@ -492,7 +495,10 @@ public class MapActivityActions implements DialogProvider {
}
ApplicationMode mode = getAppMode(buttons, settings);
// change global settings
// Do not overwrite PREV_APPLICATION_MODE if already navigating
if (!routingHelper.isFollowingMode()) {
settings.PREV_APPLICATION_MODE.set(settings.APPLICATION_MODE.get());
}
boolean changed = settings.APPLICATION_MODE.set(mode);
if (changed) {
mapActivity.updateApplicationModeSettings();

View file

@ -409,7 +409,7 @@ public class ParkingPositionPlugin extends OsmandPlugin {
* @return
*/
private boolean distChanged(int oldDist, int dist){
if(oldDist != 0 && oldDist - dist < 30){
if(oldDist != 0 && Math.abs(oldDist - dist) < 30){
return false;
}
return true;

View file

@ -603,7 +603,7 @@ public class RouteInfoControls {
public boolean distChanged(int oldDist, int dist){
if(oldDist != 0 && oldDist - dist < 10){
if(oldDist != 0 && Math.abs(oldDist - dist) < 10){
return false;
}
return true;