Don't overwrite units of measurement in automatic region
This commit is contained in:
parent
8ff6eff178
commit
38d6183a43
1 changed files with 2 additions and 1 deletions
|
@ -848,7 +848,8 @@ public class OsmandSettings {
|
||||||
public final OsmandPreference<DrivingRegion> DRIVING_REGION = new EnumStringPreference<DrivingRegion>(this,
|
public final OsmandPreference<DrivingRegion> DRIVING_REGION = new EnumStringPreference<DrivingRegion>(this,
|
||||||
"default_driving_region", DrivingRegion.EUROPE_ASIA, DrivingRegion.values()) {
|
"default_driving_region", DrivingRegion.EUROPE_ASIA, DrivingRegion.values()) {
|
||||||
public boolean setValue(Object prefs, DrivingRegion val) {
|
public boolean setValue(Object prefs, DrivingRegion val) {
|
||||||
if (val != null) {
|
boolean overrideMetricSystem = !DRIVING_REGION_AUTOMATIC.getValue(prefs, DRIVING_REGION_AUTOMATIC.getDefaultValue());
|
||||||
|
if (overrideMetricSystem && val != null) {
|
||||||
METRIC_SYSTEM.set(val.defMetrics);
|
METRIC_SYSTEM.set(val.defMetrics);
|
||||||
}
|
}
|
||||||
return super.setValue(prefs, val);
|
return super.setValue(prefs, val);
|
||||||
|
|
Loading…
Reference in a new issue