diff options
author | Daniel Sandler <dsandler@android.com> | 2012-11-29 14:28:07 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-11-29 14:28:07 -0800 |
commit | e196eb76428976df1bf5ee75ff81bdaa30d796b6 (patch) | |
tree | 5bae8659651b43bdf6948c7848a19d90907325db /packages | |
parent | a5fa049562333ad154c38e47d0ec7845941d6c21 (diff) | |
parent | a8a63dd7d9d49930b70371319b5712aed17a9c4c (diff) | |
download | frameworks_base-e196eb76428976df1bf5ee75ff81bdaa30d796b6.zip frameworks_base-e196eb76428976df1bf5ee75ff81bdaa30d796b6.tar.gz frameworks_base-e196eb76428976df1bf5ee75ff81bdaa30d796b6.tar.bz2 |
am a8a63dd7: am 154e2d7d: Merge "Flush the clock format when the locale changes." into jb-mr1.1-dev
* commit 'a8a63dd7d9d49930b70371319b5712aed17a9c4c':
Flush the clock format when the locale changes.
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java index 8f2a4eb..e41de47 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java @@ -40,6 +40,7 @@ import android.widget.TextView; import java.text.SimpleDateFormat; import java.util.Calendar; +import java.util.Locale; import java.util.TimeZone; import com.android.internal.R; @@ -52,6 +53,7 @@ public class Clock extends TextView { private Calendar mCalendar; private String mClockFormatString; private SimpleDateFormat mClockFormat; + private Locale mLocale; private static final int AM_PM_STYLE_NORMAL = 0; private static final int AM_PM_STYLE_SMALL = 1; @@ -117,6 +119,12 @@ public class Clock extends TextView { if (mClockFormat != null) { mClockFormat.setTimeZone(mCalendar.getTimeZone()); } + } else if (action.equals(Intent.ACTION_CONFIGURATION_CHANGED)) { + final Locale newLocale = getResources().getConfiguration().locale; + if (! newLocale.equals(mLocale)) { + mLocale = newLocale; + mClockFormatString = ""; // force refresh + } } updateClock(); } |