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). 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 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="current_track">Current track</string>
<string name="map_widget_battery">Battery level</string> <string name="map_widget_battery">Battery level</string>
<string name="change_markers_position">Change marker\'s position</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(). 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(); 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(); 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(). public static final ApplicationMode BICYCLE = create(R.string.app_mode_bicycle, "bicycle").speed(5.5f, 15).arrivalDistance(60).bicycleLocation().
@ -48,10 +48,17 @@ public class ApplicationMode {
public static final ApplicationMode TRUCK = create(R.string.app_mode_truck, "truck").speed(15.3f, 40). public static final ApplicationMode TRUCK = create(R.string.app_mode_truck, "truck").speed(15.3f, 40).
carLocation().parent(CAR). carLocation().parent(CAR).
icon(R.drawable.ic_truck, R.drawable.ic_action_truck_dark).reg(); 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 { static {
ApplicationMode[] exceptDefault = new ApplicationMode[] { CAR, PEDESTRIAN, BICYCLE, BOAT, AIRCRAFT }; ApplicationMode[] exceptDefault = new ApplicationMode[] { CAR, PEDESTRIAN, BICYCLE, BOAT, AIRCRAFT, BUS, TRAIN };
ApplicationMode[] exceptPedestrianAndDefault = new ApplicationMode[] { CAR, BICYCLE, BOAT, AIRCRAFT }; ApplicationMode[] exceptPedestrianAndDefault = new ApplicationMode[] { CAR, BICYCLE, BOAT, AIRCRAFT, BUS, TRAIN };
ApplicationMode[] exceptAirBoatDefault = new ApplicationMode[] { CAR, BICYCLE, PEDESTRIAN }; ApplicationMode[] exceptAirBoatDefault = new ApplicationMode[] { CAR, BICYCLE, PEDESTRIAN };
ApplicationMode[] pedestrian = new ApplicationMode[] { PEDESTRIAN }; ApplicationMode[] pedestrian = new ApplicationMode[] { PEDESTRIAN };
ApplicationMode[] pedestrianBicycle = new ApplicationMode[] { PEDESTRIAN, BICYCLE }; ApplicationMode[] pedestrianBicycle = new ApplicationMode[] { PEDESTRIAN, BICYCLE };

View file

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