diff options
author | Danesh M <daneshm90@gmail.com> | 2016-02-05 15:58:54 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-02-08 10:04:25 -0800 |
commit | 0ba618fb1ed8a67065f7964d13a8f7fb73f8b8dd (patch) | |
tree | 63d94ae4f97515affa47ed551d3a859fabb493ce /packages/SystemUI/src | |
parent | 980266b4593c0cbf5a169a9be8f1e61c8faaad9a (diff) | |
download | frameworks_base-0ba618fb1ed8a67065f7964d13a8f7fb73f8b8dd.zip frameworks_base-0ba618fb1ed8a67065f7964d13a8f7fb73f8b8dd.tar.gz frameworks_base-0ba618fb1ed8a67065f7964d13a8f7fb73f8b8dd.tar.bz2 |
LiveDisplayTile : Update entries on locale changes
YAM-21
Change-Id: I3abd262239fedf771b0b2ff38dadb42490f42432
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/tiles/LiveDisplayTile.java | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/LiveDisplayTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/LiveDisplayTile.java index b14934f..f59c876 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/LiveDisplayTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/LiveDisplayTile.java @@ -16,14 +16,12 @@ package com.android.systemui.qs.tiles; -import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.content.res.TypedArray; import android.database.ContentObserver; import android.os.Handler; import android.os.UserHandle; -import android.provider.Settings; import com.android.internal.util.ArrayUtils; import com.android.systemui.R; @@ -40,10 +38,10 @@ public class LiveDisplayTile extends QSTile<LiveDisplayTile.LiveDisplayState> { new Intent("android.settings.LIVEDISPLAY_SETTINGS"); private final LiveDisplayObserver mObserver; - private final String[] mEntries; - private final String[] mDescriptionEntries; - private final String[] mAnnouncementEntries; - private final String[] mValues; + private String[] mEntries; + private String[] mDescriptionEntries; + private String[] mAnnouncementEntries; + private String[] mValues; private final int[] mEntryIconRes; private boolean mListening; @@ -69,10 +67,7 @@ public class LiveDisplayTile extends QSTile<LiveDisplayTile.LiveDisplayState> { } typedArray.recycle(); - mEntries = res.getStringArray(com.android.internal.R.array.live_display_entries); - mDescriptionEntries = res.getStringArray(R.array.live_display_description); - mAnnouncementEntries = res.getStringArray(R.array.live_display_announcement); - mValues = res.getStringArray(com.android.internal.R.array.live_display_values); + updateEntries(); mOutdoorModeAvailable = CMHardwareManager.getInstance(mContext) @@ -86,6 +81,14 @@ public class LiveDisplayTile extends QSTile<LiveDisplayTile.LiveDisplayState> { mObserver.startObserving(); } + private void updateEntries() { + Resources res = mContext.getResources(); + mEntries = res.getStringArray(com.android.internal.R.array.live_display_entries); + mDescriptionEntries = res.getStringArray(R.array.live_display_description); + mAnnouncementEntries = res.getStringArray(R.array.live_display_announcement); + mValues = res.getStringArray(com.android.internal.R.array.live_display_values); + } + @Override protected LiveDisplayState newTileState() { return new LiveDisplayState(); @@ -115,6 +118,7 @@ public class LiveDisplayTile extends QSTile<LiveDisplayTile.LiveDisplayState> { @Override protected void handleUpdateState(LiveDisplayState state, Object arg) { + updateEntries(); state.visible = true; state.mode = arg == null ? getCurrentModeIndex() : (Integer) arg; state.label = mEntries[state.mode]; |