diff options
author | Victoria Lease <violets@google.com> | 2013-10-23 17:56:53 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-10-23 17:56:54 +0000 |
commit | 5eb3e07c5d8647f2bc250d37feb0c905621b2f90 (patch) | |
tree | 3b03f7b7cea0bd5f01e583718aea98f48d016bdd /packages | |
parent | 910c2857937b33391e02558c4b396aefa489f213 (diff) | |
parent | 3ac54a3a5184a5da1e294c46517e38378b84e8e7 (diff) | |
download | frameworks_base-5eb3e07c5d8647f2bc250d37feb0c905621b2f90.zip frameworks_base-5eb3e07c5d8647f2bc250d37feb0c905621b2f90.tar.gz frameworks_base-5eb3e07c5d8647f2bc250d37feb0c905621b2f90.tar.bz2 |
Merge "add accessibility string for location quicksetting" into klp-dev
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/res/values/strings.xml | 2 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java | 15 |
2 files changed, 15 insertions, 2 deletions
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index 58865ab..e6fcdff 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -382,6 +382,8 @@ <string name="accessibility_quick_settings_airplane">Airplane Mode <xliff:g id="state" example="Off">%s</xliff:g>.</string> <!-- Content description of the bluetooth tile in quick settings (not shown on the screen). [CHAR LIMIT=NONE] --> <string name="accessibility_quick_settings_bluetooth">Bluetooth <xliff:g id="state" example="Off">%s</xliff:g>.</string> + <!-- Content description of the location tile in quick settings (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_quick_settings_location">Location <xliff:g id="state" example="Off">%s</xliff:g>.</string> <!-- Content description of the alarm tile in quick settings (not shown on the screen). [CHAR LIMIT=NONE] --> <string name="accessibility_quick_settings_alarm">Alarm set for <xliff:g id="time" example="Wed 3:30 PM">%s</xliff:g>.</string> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java index 5423bb6..37504fb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java @@ -630,8 +630,19 @@ class QuickSettings { return true; // Consume click }} ); } - mModel.addLocationTile(locationTile, - new QuickSettingsModel.BasicRefreshCallback(locationTile)); + mModel.addLocationTile(locationTile, new QuickSettingsModel.RefreshCallback() { + @Override + public void refreshView(QuickSettingsTileView unused, State state) { + locationTile.setImageResource(state.iconId); + String locationState = mContext.getString( + (state.enabled) ? R.string.accessibility_desc_on + : R.string.accessibility_desc_off); + locationTile.setContentDescription(mContext.getString( + R.string.accessibility_quick_settings_location, + locationState)); + locationTile.setText(state.label); + } + }); parent.addView(locationTile); } |