Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-06-07 11:04:30 +02:00
commit 17c5295f91
3 changed files with 18 additions and 7 deletions

View file

@ -9,7 +9,8 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
<string name="app_mode_bus">Bus</string>
<string name="app_mode_train">Train</string>
<string name="current_track">Current track</string>
<string name="map_widget_battery">Battery level</string>
<string name="change_markers_position">Change marker\'s position</string>

View file

@ -23,7 +23,7 @@ public class ApplicationMode {
public static final ApplicationMode DEFAULT = create(R.string.app_mode_default, "default").speed(1.5f, 5).arrivalDistance(90).defLocation().
icon(R.drawable.ic_browse_map, R.drawable.ic_world_globe_dark).reg();
public static final ApplicationMode CAR = create(R.string.app_mode_car, "car").speed(15.3f, 35).arrivalDistance(90).carLocation().
public static final ApplicationMode CAR = create(R.string.app_mode_car, "car").speed(15.3f, 35).carLocation().
icon(R.drawable.ic_car, R.drawable.ic_action_car_dark).reg();
public static final ApplicationMode BICYCLE = create(R.string.app_mode_bicycle, "bicycle").speed(5.5f, 15).arrivalDistance(60).bicycleLocation().
@ -49,9 +49,16 @@ public class ApplicationMode {
carLocation().parent(CAR).
icon(R.drawable.ic_truck, R.drawable.ic_action_truck_dark).reg();
public static final ApplicationMode BUS = create(R.string.app_mode_bus, "bus").speed(15.3f, 40).
carLocation().parent(CAR).
icon(R.drawable.ic_action_bus2, R.drawable.ic_action_bus_dark).reg();
public static final ApplicationMode TRAIN = create(R.string.app_mode_train, "train").speed(25f, 40).
carLocation().icon(R.drawable.ic_action_train, R.drawable.ic_action_train).reg();
static {
ApplicationMode[] exceptDefault = new ApplicationMode[] { CAR, PEDESTRIAN, BICYCLE, BOAT, AIRCRAFT };
ApplicationMode[] exceptPedestrianAndDefault = new ApplicationMode[] { CAR, BICYCLE, BOAT, AIRCRAFT };
ApplicationMode[] exceptDefault = new ApplicationMode[] { CAR, PEDESTRIAN, BICYCLE, BOAT, AIRCRAFT, BUS, TRAIN };
ApplicationMode[] exceptPedestrianAndDefault = new ApplicationMode[] { CAR, BICYCLE, BOAT, AIRCRAFT, BUS, TRAIN };
ApplicationMode[] exceptAirBoatDefault = new ApplicationMode[] { CAR, BICYCLE, PEDESTRIAN };
ApplicationMode[] pedestrian = new ApplicationMode[] { PEDESTRIAN };
ApplicationMode[] pedestrianBicycle = new ApplicationMode[] { PEDESTRIAN, BICYCLE };

View file

@ -472,8 +472,7 @@ public class RoutingHelper {
// 2. check if intermediate found
if(route.getIntermediatePointsToPass() > 0
&& route.getDistanceToNextIntermediate(lastFixedLocation) < POSITION_TOLERANCE * 2 * settings.ARRIVAL_DISTANCE_FACTOR.get()
&& !isRoutePlanningMode) {
&& route.getDistanceToNextIntermediate(lastFixedLocation) < getArrivalDistance() * 2f && !isRoutePlanningMode) {
showMessage(app.getString(R.string.arrived_at_intermediate_point));
route.passIntermediatePoint();
TargetPointsHelper targets = app.getTargetPointsHelper();
@ -505,7 +504,7 @@ public class RoutingHelper {
// 3. check if destination found
Location lastPoint = routeNodes.get(routeNodes.size() - 1);
if (currentRoute > routeNodes.size() - 3
&& currentLocation.distanceTo(lastPoint) < (((float)settings.getApplicationMode().getArrivalDistance()) * settings.ARRIVAL_DISTANCE_FACTOR.get())
&& currentLocation.distanceTo(lastPoint) < getArrivalDistance()
&& !isRoutePlanningMode) {
//showMessage(app.getString(R.string.arrived_at_destination));
TargetPointsHelper targets = app.getTargetPointsHelper();
@ -535,6 +534,10 @@ public class RoutingHelper {
return false;
}
private float getArrivalDistance() {
return ((float)settings.getApplicationMode().getArrivalDistance()) * settings.ARRIVAL_DISTANCE_FACTOR.get();
}
public boolean identifyUTurnIsNeeded(Location currentLocation, float posTolerance) {
if (finalLocation == null || currentLocation == null || !route.isCalculated()) {