aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/cyanogenmod/lockclock/preference/WeatherPreferences.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/cyanogenmod/lockclock/preference/WeatherPreferences.java')
-rw-r--r--src/com/cyanogenmod/lockclock/preference/WeatherPreferences.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/cyanogenmod/lockclock/preference/WeatherPreferences.java b/src/com/cyanogenmod/lockclock/preference/WeatherPreferences.java
index 91d4628..f1468df 100644
--- a/src/com/cyanogenmod/lockclock/preference/WeatherPreferences.java
+++ b/src/com/cyanogenmod/lockclock/preference/WeatherPreferences.java
@@ -64,6 +64,7 @@ public class WeatherPreferences extends PreferenceFragment implements
private EditTextPreference mCustomWeatherLoc;
private ListPreference mFontColor;
private ListPreference mTimestampFontColor;
+ private CheckBoxPreference mUseMetric;
private Context mContext;
private ContentResolver mResolver;
@@ -87,6 +88,8 @@ public class WeatherPreferences extends PreferenceFragment implements
mTimestampFontColor = (ListPreference) findPreference(Constants.WEATHER_TIMESTAMP_FONT_COLOR);
updateFontColorsSummary();
+ mUseMetric = (CheckBoxPreference) findPreference(Constants.WEATHER_USE_METRIC);
+
// Show a warning if location manager is disabled and there is no custom location set
if (!Settings.Secure.isLocationProviderEnabled(mResolver,
LocationManager.NETWORK_PROVIDER)
@@ -122,6 +125,12 @@ public class WeatherPreferences extends PreferenceFragment implements
boolean needWeatherUpdate = false;
boolean forceWeatherUpdate = false;
+ if (pref == mUseMetric) {
+ // The display format of the temperatures have changed
+ // Force a weather update to refresh the display
+ forceWeatherUpdate = true;
+ }
+
for (String k : LOCATION_PREF_KEYS) {
if (TextUtils.equals(key, k)) {
// location pref has changed -> clear out woeid cache