From d1e4a2b3211f36d821df838a61fa358bd209f809 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 5 Aug 2013 01:45:16 +0200 Subject: [PATCH] Update Countries --- OsmAnd/res/values/strings.xml | 1 + OsmAnd/src/net/osmand/plus/OsmandSettings.java | 3 ++- .../plus/activities/SettingsGeneralActivity.java | 11 ++++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index ed762b6a6d..6f83c8f9bb 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -14,6 +14,7 @@ Driving Region Japan United States + Canada Europe & Asia UK, India, Australia & Others Stop OsMoDroid diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index 869c594b9d..7e822ef21b 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -1520,7 +1520,8 @@ public class OsmandSettings { public enum DrivingRegion { EUROPE_ASIA(R.string.driving_region_europe_asia, MetricsConstants.KILOMETERS_AND_METERS, false, false), - US_CANADA(R.string.driving_region_us, MetricsConstants.MILES_AND_FOOTS, false, true), + US(R.string.driving_region_us, MetricsConstants.MILES_AND_FOOTS, false, true), + CANADA(R.string.driving_region_canada, MetricsConstants.KILOMETERS_AND_METERS, false, true), UK_AND_OTHERS(R.string.driving_region_uk, MetricsConstants.MILES_AND_FOOTS, true, false), JAPAN(R.string.driving_region_japan, MetricsConstants.KILOMETERS_AND_METERS, true, false) ; diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java index 575fbe7a00..b1ce2d6626 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java @@ -43,6 +43,8 @@ public class SettingsGeneralActivity extends SettingsBaseActivity { private Preference applicationDir; private ListPreference applicationModePreference; + private ListPreference drivingRegionPreference; + private ListPreference metricsAndConstantsPreference; @Override @@ -208,7 +210,8 @@ public class SettingsGeneralActivity extends SettingsBaseActivity { applicationModePreference = (ListPreference) screen.findPreference(settings.APPLICATION_MODE.getId()); applicationModePreference.setOnPreferenceChangeListener(this); - + drivingRegionPreference = (ListPreference) screen.findPreference(settings.DRIVING_REGION.getId()); + metricsAndConstantsPreference = (ListPreference) screen.findPreference(settings.METRIC_SYSTEM.getId()); } @@ -226,6 +229,10 @@ public class SettingsGeneralActivity extends SettingsBaseActivity { applicationModePreference.setTitle(getString(R.string.settings_preset) + " [" + settings.APPLICATION_MODE.get().toHumanString(getMyApplication()) + "]"); + drivingRegionPreference.setTitle(getString(R.string.driving_region) + " [" + + getString(settings.DRIVING_REGION.get().name) + "]"); + metricsAndConstantsPreference.setTitle(getString(R.string.unit_of_length) + " [" + + settings.METRIC_SYSTEM.get().toHumanString(getMyApplication()) + "]"); } @Override @@ -252,6 +259,8 @@ public class SettingsGeneralActivity extends SettingsBaseActivity { Intent intent = getIntent(); finish(); startActivity(intent); + } else { + updateAllSettings(); } return true; }