diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index 239d39b89d..8573d937cb 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -752,7 +752,7 @@ public class OsmandSettings { public final OsmandPreference DRIVING_REGION = new EnumIntPreference( "default_driving_region", DrivingRegion.EUROPE_ASIA, DrivingRegion.values()) { protected boolean setValue(Object prefs, DrivingRegion val) { - if (val != null) { + if (val != null && !METRIC_SYSTEM_CHANGED_MANUALLY.get()) { METRIC_SYSTEM.set(val.defMetrics); } return super.setValue(prefs, val); @@ -783,6 +783,8 @@ public class OsmandSettings { ; }.makeGlobal().cache(); + public final CommonPreference METRIC_SYSTEM_CHANGED_MANUALLY = new BooleanPreference("metric_system_changed_manually", false).makeGlobal(); + // this value string is synchronized with settings_pref.xml preference name // cache of metrics constants as they are used very often public final OsmandPreference METRIC_SYSTEM = new EnumIntPreference( diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java index 688354f63e..b07ab4427d 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java @@ -516,6 +516,8 @@ public class SettingsGeneralActivity extends SettingsBaseActivity implements OnR restartApp(); } else if (id.equals(settings.OSMAND_THEME.getId())) { restartApp(); + } else if (id.equals(settings.METRIC_SYSTEM.getId())) { + settings.METRIC_SYSTEM_CHANGED_MANUALLY.set(true); } else { updateAllSettings(); } diff --git a/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java b/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java index 124b19839b..200dc58369 100644 --- a/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java +++ b/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java @@ -78,6 +78,7 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity { getMyApplication().getSettings().FIRST_MAP_IS_DOWNLOADED.set(false); getMyApplication().getSettings().MAPILLARY_FIRST_DIALOG_SHOWN.set(false); getMyApplication().getSettings().WEBGL_SUPPORTED.set(true); + getMyApplication().getSettings().METRIC_SYSTEM_CHANGED_MANUALLY.set(false); getMyApplication().showToastMessage(R.string.shared_string_ok); return true; }