Loading packages/SystemUI/res/layout/quick_settings_brightness_dialog.xml +1 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ android:layout_gravity="center_vertical" android:layout_weight="1" android:contentDescription="@string/accessibility_brightness" android:importantForAccessibility="no" systemui:text="@string/status_bar_settings_auto_brightness_label" /> </LinearLayout> packages/SystemUI/src/com/android/systemui/qs/QSPanel.java +2 −0 Original line number Diff line number Diff line Loading @@ -472,6 +472,7 @@ public class QSPanel extends ViewGroup { rows = r + 1; } View previousView = mBrightnessView; for (TileRecord record : mRecords) { if (record.tileView.setDual(record.tile.supportsDualTargets())) { record.tileView.handleStateChanged(record.tile.getState()); Loading @@ -480,6 +481,7 @@ public class QSPanel extends ViewGroup { final int cw = record.row == 0 ? mLargeCellWidth : mCellWidth; final int ch = record.row == 0 ? mLargeCellHeight : mCellHeight; record.tileView.measure(exactly(cw), exactly(ch)); previousView = record.tileView.updateAccessibilityOrder(previousView); } int h = rows == 0 ? brightnessHeight : (getRowTop(rows) + mPanelPaddingBottom); if (mFooter.hasFooter()) { Loading packages/SystemUI/src/com/android/systemui/qs/QSTileView.java +24 −3 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ public class QSTileView extends ViewGroup { setClipChildren(false); mTopBackgroundView = new View(context); mTopBackgroundView.setId(View.generateViewId()); addView(mTopBackgroundView); mIcon = createIcon(); Loading @@ -95,8 +96,8 @@ public class QSTileView extends ViewGroup { addView(mDivider); setClickable(true); updateTopPadding(); setId(View.generateViewId()); } private void updateTopPadding() { Loading Loading @@ -137,7 +138,7 @@ public class QSTileView extends ViewGroup { final Resources res = mContext.getResources(); if (mDual) { mDualLabel = new QSDualTileLabel(mContext); mDualLabel.setId(android.R.id.title); mDualLabel.setId(View.generateViewId()); mDualLabel.setBackgroundResource(R.drawable.btn_borderless_rect); mDualLabel.setFirstLineCaret(mContext.getDrawable(R.drawable.qs_dual_tile_caret)); mDualLabel.setTextColor(mContext.getColor(R.color.qs_tile_text)); Loading @@ -155,9 +156,9 @@ public class QSTileView extends ViewGroup { mDualLabel.setContentDescription(labelDescription); } addView(mDualLabel); mDualLabel.setAccessibilityTraversalAfter(mTopBackgroundView.getId()); } else { mLabel = new TextView(mContext); mLabel.setId(android.R.id.title); mLabel.setTextColor(mContext.getColor(R.color.qs_tile_text)); mLabel.setGravity(Gravity.CENTER_HORIZONTAL); mLabel.setMinLines(2); Loading Loading @@ -328,6 +329,26 @@ public class QSTileView extends ViewGroup { mHandler.obtainMessage(H.STATE_CHANGED, state).sendToTarget(); } /** * Update the accessibility order for this view. * * @param previousView the view which should be before this one * @return the last view in this view which is accessible */ public View updateAccessibilityOrder(View previousView) { View firstView; View lastView; if (mDual) { lastView = mDualLabel; firstView = mTopBackgroundView; } else { firstView = this; lastView = this; } firstView.setAccessibilityTraversalAfter(previousView.getId()); return lastView; } private class H extends Handler { private static final int STATE_CHANGED = 1; public H() { Loading packages/SystemUI/src/com/android/systemui/settings/ToggleSeekBar.java +16 −0 Original line number Diff line number Diff line Loading @@ -19,9 +19,13 @@ package com.android.systemui.settings; import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.view.accessibility.AccessibilityNodeInfo; import android.widget.SeekBar; public class ToggleSeekBar extends SeekBar { private String mAccessibilityLabel; public ToggleSeekBar(Context context) { super(context); } Loading @@ -42,4 +46,16 @@ public class ToggleSeekBar extends SeekBar { return super.onTouchEvent(event); } public void setAccessibilityLabel(String label) { mAccessibilityLabel = label; } @Override public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { super.onInitializeAccessibilityNodeInfo(info); if (mAccessibilityLabel != null) { info.setText(mAccessibilityLabel); } } } packages/SystemUI/src/com/android/systemui/settings/ToggleSlider.java +3 −3 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ public class ToggleSlider extends RelativeLayout { private boolean mTracking; private CompoundButton mToggle; private SeekBar mSlider; private ToggleSeekBar mSlider; private TextView mLabel; private ToggleSlider mMirror; Loading @@ -69,13 +69,13 @@ public class ToggleSlider extends RelativeLayout { mToggle = (CompoundButton) findViewById(R.id.toggle); mToggle.setOnCheckedChangeListener(mCheckListener); mSlider = (SeekBar) findViewById(R.id.slider); mSlider = (ToggleSeekBar) findViewById(R.id.slider); mSlider.setOnSeekBarChangeListener(mSeekListener); mLabel = (TextView) findViewById(R.id.label); mLabel.setText(a.getString(R.styleable.ToggleSlider_text)); setLabelFor(R.id.slider); // use our a11y text to annotate, not replace, the slider's mSlider.setAccessibilityLabel(getContentDescription().toString()); a.recycle(); } Loading Loading
packages/SystemUI/res/layout/quick_settings_brightness_dialog.xml +1 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ android:layout_gravity="center_vertical" android:layout_weight="1" android:contentDescription="@string/accessibility_brightness" android:importantForAccessibility="no" systemui:text="@string/status_bar_settings_auto_brightness_label" /> </LinearLayout>
packages/SystemUI/src/com/android/systemui/qs/QSPanel.java +2 −0 Original line number Diff line number Diff line Loading @@ -472,6 +472,7 @@ public class QSPanel extends ViewGroup { rows = r + 1; } View previousView = mBrightnessView; for (TileRecord record : mRecords) { if (record.tileView.setDual(record.tile.supportsDualTargets())) { record.tileView.handleStateChanged(record.tile.getState()); Loading @@ -480,6 +481,7 @@ public class QSPanel extends ViewGroup { final int cw = record.row == 0 ? mLargeCellWidth : mCellWidth; final int ch = record.row == 0 ? mLargeCellHeight : mCellHeight; record.tileView.measure(exactly(cw), exactly(ch)); previousView = record.tileView.updateAccessibilityOrder(previousView); } int h = rows == 0 ? brightnessHeight : (getRowTop(rows) + mPanelPaddingBottom); if (mFooter.hasFooter()) { Loading
packages/SystemUI/src/com/android/systemui/qs/QSTileView.java +24 −3 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ public class QSTileView extends ViewGroup { setClipChildren(false); mTopBackgroundView = new View(context); mTopBackgroundView.setId(View.generateViewId()); addView(mTopBackgroundView); mIcon = createIcon(); Loading @@ -95,8 +96,8 @@ public class QSTileView extends ViewGroup { addView(mDivider); setClickable(true); updateTopPadding(); setId(View.generateViewId()); } private void updateTopPadding() { Loading Loading @@ -137,7 +138,7 @@ public class QSTileView extends ViewGroup { final Resources res = mContext.getResources(); if (mDual) { mDualLabel = new QSDualTileLabel(mContext); mDualLabel.setId(android.R.id.title); mDualLabel.setId(View.generateViewId()); mDualLabel.setBackgroundResource(R.drawable.btn_borderless_rect); mDualLabel.setFirstLineCaret(mContext.getDrawable(R.drawable.qs_dual_tile_caret)); mDualLabel.setTextColor(mContext.getColor(R.color.qs_tile_text)); Loading @@ -155,9 +156,9 @@ public class QSTileView extends ViewGroup { mDualLabel.setContentDescription(labelDescription); } addView(mDualLabel); mDualLabel.setAccessibilityTraversalAfter(mTopBackgroundView.getId()); } else { mLabel = new TextView(mContext); mLabel.setId(android.R.id.title); mLabel.setTextColor(mContext.getColor(R.color.qs_tile_text)); mLabel.setGravity(Gravity.CENTER_HORIZONTAL); mLabel.setMinLines(2); Loading Loading @@ -328,6 +329,26 @@ public class QSTileView extends ViewGroup { mHandler.obtainMessage(H.STATE_CHANGED, state).sendToTarget(); } /** * Update the accessibility order for this view. * * @param previousView the view which should be before this one * @return the last view in this view which is accessible */ public View updateAccessibilityOrder(View previousView) { View firstView; View lastView; if (mDual) { lastView = mDualLabel; firstView = mTopBackgroundView; } else { firstView = this; lastView = this; } firstView.setAccessibilityTraversalAfter(previousView.getId()); return lastView; } private class H extends Handler { private static final int STATE_CHANGED = 1; public H() { Loading
packages/SystemUI/src/com/android/systemui/settings/ToggleSeekBar.java +16 −0 Original line number Diff line number Diff line Loading @@ -19,9 +19,13 @@ package com.android.systemui.settings; import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.view.accessibility.AccessibilityNodeInfo; import android.widget.SeekBar; public class ToggleSeekBar extends SeekBar { private String mAccessibilityLabel; public ToggleSeekBar(Context context) { super(context); } Loading @@ -42,4 +46,16 @@ public class ToggleSeekBar extends SeekBar { return super.onTouchEvent(event); } public void setAccessibilityLabel(String label) { mAccessibilityLabel = label; } @Override public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { super.onInitializeAccessibilityNodeInfo(info); if (mAccessibilityLabel != null) { info.setText(mAccessibilityLabel); } } }
packages/SystemUI/src/com/android/systemui/settings/ToggleSlider.java +3 −3 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ public class ToggleSlider extends RelativeLayout { private boolean mTracking; private CompoundButton mToggle; private SeekBar mSlider; private ToggleSeekBar mSlider; private TextView mLabel; private ToggleSlider mMirror; Loading @@ -69,13 +69,13 @@ public class ToggleSlider extends RelativeLayout { mToggle = (CompoundButton) findViewById(R.id.toggle); mToggle.setOnCheckedChangeListener(mCheckListener); mSlider = (SeekBar) findViewById(R.id.slider); mSlider = (ToggleSeekBar) findViewById(R.id.slider); mSlider.setOnSeekBarChangeListener(mSeekListener); mLabel = (TextView) findViewById(R.id.label); mLabel.setText(a.getString(R.styleable.ToggleSlider_text)); setLabelFor(R.id.slider); // use our a11y text to annotate, not replace, the slider's mSlider.setAccessibilityLabel(getContentDescription().toString()); a.recycle(); } Loading