diff options
Diffstat (limited to 'src/com/cyanogenmod/lockclock/preference')
-rw-r--r-- | src/com/cyanogenmod/lockclock/preference/WeatherPreferences.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/cyanogenmod/lockclock/preference/WeatherPreferences.java b/src/com/cyanogenmod/lockclock/preference/WeatherPreferences.java index 9b06246..94537c0 100644 --- a/src/com/cyanogenmod/lockclock/preference/WeatherPreferences.java +++ b/src/com/cyanogenmod/lockclock/preference/WeatherPreferences.java @@ -81,6 +81,12 @@ public class WeatherPreferences extends PreferenceFragment implements mUseMetric = (CheckBoxPreference) findPreference(Constants.WEATHER_USE_METRIC); mUseCustomlocation = (CheckBoxPreference) findPreference(Constants.WEATHER_USE_CUSTOM_LOCATION); + // At first placement/start default the use of Metric units based on locale + // If we had a previously set value already, this will just reset the same value + Boolean defValue = Preferences.useMetricUnits(mContext); + Preferences.setUseMetricUnits(mContext, defValue); + mUseMetric.setChecked(defValue); + // Show a warning if location manager is disabled and there is no custom location set LocationManager lm = (LocationManager) getActivity().getSystemService(Context.LOCATION_SERVICE); if (!lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER) && !mUseCustomLoc.isChecked()) { @@ -91,6 +97,7 @@ public class WeatherPreferences extends PreferenceFragment implements @Override public void onResume() { super.onResume(); + getPreferenceManager().getSharedPreferences().registerOnSharedPreferenceChangeListener(this); updateLocationSummary(); updateFontColorsSummary(); |