diff options
| author | 2015-06-08 15:34:05 -0400 | |
|---|---|---|
| committer | 2015-06-08 15:34:05 -0400 | |
| commit | a1c7ffe755d414a1082920ce1742a8ae82d81529 (patch) | |
| tree | d62e979721a7094291a716447a7550da2768ec2b | |
| parent | 281dffb76f1bb0e0e9d012fb9b111b040f4745d7 (diff) | |
Zen QS: Use explicit content descriptions for zen buttons.
Bug: 21661136
Change-Id: I3a6f7d6deb29584e707c1deb771e3db660007529
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/volume/SegmentedButtons.java | 3 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/volume/SegmentedButtons.java b/packages/SystemUI/src/com/android/systemui/volume/SegmentedButtons.java index f7cb9fec61cd..cb9a649934b7 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/SegmentedButtons.java +++ b/packages/SystemUI/src/com/android/systemui/volume/SegmentedButtons.java @@ -68,10 +68,11 @@ public class SegmentedButtons extends LinearLayout { fireOnSelected(); } - public void addButton(int labelResId, Object value) { + public void addButton(int labelResId, int contentDescriptionResId, Object value) { final Button b = (Button) mInflater.inflate(R.layout.segmented_button, this, false); b.setTag(LABEL_RES_KEY, labelResId); b.setText(labelResId); + b.setContentDescription(getResources().getString(contentDescriptionResId)); final LayoutParams lp = (LayoutParams) b.getLayoutParams(); if (getChildCount() == 0) { lp.leftMargin = lp.rightMargin = 0; // first button has no margin diff --git a/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java b/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java index 027d6377a6bd..92c508ef5d44 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java +++ b/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java @@ -151,10 +151,13 @@ public class ZenModePanel extends LinearLayout { mZenButtons = (SegmentedButtons) findViewById(R.id.zen_buttons); mZenButtons.addButton(R.string.interruption_level_none_twoline, + R.string.interruption_level_none, Global.ZEN_MODE_NO_INTERRUPTIONS); mZenButtons.addButton(R.string.interruption_level_alarms_twoline, + R.string.interruption_level_alarms, Global.ZEN_MODE_ALARMS); mZenButtons.addButton(R.string.interruption_level_priority_twoline, + R.string.interruption_level_priority, Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS); mZenButtons.setCallback(mZenButtonsCallback); |