Merge "Zen QS: Use explicit content descriptions for zen buttons." into mnc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c0f7aff3df
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user