Merge pull request #11032 from osmandapp/fix_units_switch
Don't overwrite units of measurement in automatic region
This commit is contained in:
commit
29897a247e
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,
|
||||
"default_driving_region", DrivingRegion.EUROPE_ASIA, DrivingRegion.values()) {
|
||||
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);
|
||||
}
|
||||
return super.setValue(prefs, val);
|
||||
|
|
Loading…
Reference in a new issue