Rename setting

This commit is contained in:
PavelRatushny 2017-09-07 18:51:04 +03:00
parent 56bf4cd17f
commit 4ba50ff806
5 changed files with 9 additions and 9 deletions

View file

@ -9,8 +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="speed_for_map_to_direction_of_movement">Speed for map to direction of movement</string>
<string name="speed_for_map_to_direction_of_movement_descr">Specify speed when map should rotate to direction of movement instead of compass</string>
<string name="map_orientation_change_in_accordance_with_speed">Map orientation change in accordance with speed</string>
<string name="map_orientation_change_in_accordance_with_speed_descr">Use built in compass instead of direction of movement to determine map orientation at low speed</string>
<string name="move_all_to_history">Move all to history</string>
<string name="build_route">Build route</string>
<string name="show_direction">Show direction</string>

View file

@ -63,8 +63,8 @@
android:title="@string/speed_limit_exceed"/>
<ListPreference
android:key="speed_for_map_to_direction_of_movement"
android:summary="@string/speed_for_map_to_direction_of_movement_descr"
android:title="@string/speed_for_map_to_direction_of_movement"/>
android:summary="@string/map_orientation_change_in_accordance_with_speed_descr"
android:title="@string/map_orientation_change_in_accordance_with_speed"/>
<!--
<CheckBoxPreference android:title="@string/show_zoom_buttons_navigation" android:summary="@string/show_zoom_buttons_navigation_descr" android:key="show_zoom_buttons_navigation" />
-->

View file

@ -855,7 +855,7 @@ public class OsmandSettings {
public final OsmandPreference<Float> SPEED_LIMIT_EXCEED =
new FloatPreference("speed_limit_exceed", 5f).makeProfile();
public final OsmandPreference<Float> SWITCH_TO_MAP_DIRECTION =
public final OsmandPreference<Float> SWITCH_MAP_DIRECTION_TO_COMPASS =
new FloatPreference("speed_for_map_to_direction_of_movement", 0f).makeProfile();
// this value string is synchronized with settings_pref.xml preference name

View file

@ -202,14 +202,14 @@ public class SettingsNavigationActivity extends SettingsBaseActivity {
speedNames[i] = speedLimitsKm[i] + " " + getString(R.string.km_h);
}
registerListPreference(settings.SPEED_LIMIT_EXCEED, screen, speedNames, speedLimitsKm);
registerListPreference(settings.SWITCH_TO_MAP_DIRECTION, screen, speedNames, speedLimitsKm);
registerListPreference(settings.SWITCH_MAP_DIRECTION_TO_COMPASS, screen, speedNames, speedLimitsKm);
} else {
String[] speedNames = new String[speedLimitsKm.length];
for (int i =0; i<speedNames.length;i++){
speedNames[i] = speedLimitsMiles[i] + " " + getString(R.string.mile_per_hour);
}
registerListPreference(settings.SPEED_LIMIT_EXCEED, screen, speedNames, speedLimitsKm);
registerListPreference(settings.SWITCH_TO_MAP_DIRECTION, screen, speedNames, speedLimitsKm);
registerListPreference(settings.SWITCH_MAP_DIRECTION_TO_COMPASS, screen, speedNames, speedLimitsKm);
}
PreferenceCategory category = (PreferenceCategory) screen.findPreference("guidance_preferences");

View file

@ -123,7 +123,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc
public void updateCompassValue(float val) {
heading = val;
if (mapView != null) {
float speedForDirectionOfMovement = settings.SWITCH_TO_MAP_DIRECTION.get();
float speedForDirectionOfMovement = settings.SWITCH_MAP_DIRECTION_TO_COMPASS.get();
boolean smallSpeedForDirectionOfMovement = speedForDirectionOfMovement != 0 && getMyLocation() != null && isSmallSpeedForDirectionOfMovement(getMyLocation(), speedForDirectionOfMovement);
if ((settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_COMPASS || (settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_BEARING && smallSpeedForDirectionOfMovement)) && !routePlanningMode) {
if (Math.abs(MapUtils.degreesDiff(mapView.getRotate(), -val)) > 1) {
@ -203,7 +203,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc
zoom = autozoom(location);
}
int currentMapRotation = settings.ROTATE_MAP.get();
float speedForDirectionOfMovement = settings.SWITCH_TO_MAP_DIRECTION.get();
float speedForDirectionOfMovement = settings.SWITCH_MAP_DIRECTION_TO_COMPASS.get();
boolean smallSpeedForDirectionOfMovement = speedForDirectionOfMovement != 0 && isSmallSpeedForDirectionOfMovement(location, speedForDirectionOfMovement);
boolean smallSpeedForCompass = isSmallSpeedForCompass(location);
boolean smallSpeedForAnimation = isSmallSpeedForAnimation(location);