From 3ac54a3a5184a5da1e294c46517e38378b84e8e7 Mon Sep 17 00:00:00 2001 From: Victoria Lease Date: Mon, 14 Oct 2013 14:54:10 -0700 Subject: add accessibility string for location quicksetting This gives the location quick setting the same ability that all the other quick settings have: the accessibility text can now be different from the display text. Bug: 11010329 Change-Id: I0dee7b6f974b4e1dc314a35e39d907e90dc8dc3c --- packages/SystemUI/res/values/strings.xml | 2 ++ .../android/systemui/statusbar/phone/QuickSettings.java | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'packages') 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 @@ Airplane Mode %s. Bluetooth %s. + + Location %s. Alarm set for %s. 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); } -- cgit v1.1