Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 977c9a5d authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android (Google) Code Review
Browse files

Merge "Removing checked state description text for accessibility from some widgets."

parents 9ad1c974 55249c86
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -226,16 +226,6 @@ public class CheckedTextView extends TextView implements Checkable {
        event.setChecked(mChecked);
    }

    @Override
    public void onPopulateAccessibilityEvent(AccessibilityEvent event) {
        super.onPopulateAccessibilityEvent(event);
        if (isChecked()) {
            event.getText().add(mContext.getString(R.string.radiobutton_selected));
        } else {
            event.getText().add(mContext.getString(R.string.radiobutton_not_selected));
        }
    }

    @Override
    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
        super.onInitializeAccessibilityNodeInfo(info);
+0 −10
Original line number Diff line number Diff line
@@ -77,16 +77,6 @@ public class RadioButton extends CompoundButton {
        }
    }

    @Override
    public void onPopulateAccessibilityEvent(AccessibilityEvent event) {
        super.onPopulateAccessibilityEvent(event);
        if (isChecked()) {
            event.getText().add(mContext.getString(R.string.radiobutton_selected));
        } else {
            event.getText().add(mContext.getString(R.string.radiobutton_not_selected));
        }
    }

    @Override
    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
        super.onInitializeAccessibilityEvent(event);
+2 −11
Original line number Diff line number Diff line
@@ -519,17 +519,8 @@ public class Switch extends CompoundButton {
    @Override
    public void onPopulateAccessibilityEvent(AccessibilityEvent event) {
        super.onPopulateAccessibilityEvent(event);
        if (isChecked()) {
            CharSequence text = mOnLayout.getText();
            if (TextUtils.isEmpty(text)) {
                text = mContext.getString(R.string.switch_on);
            }
            event.getText().add(text);
        } else {
            CharSequence text = mOffLayout.getText();
            if (TextUtils.isEmpty(text)) {
                text = mContext.getString(R.string.switch_off);
            }
        CharSequence text = isChecked() ? mOnLayout.getText() : mOffLayout.getText();
        if (!TextUtils.isEmpty(text)) {
            event.getText().add(text);
        }
    }
+0 −10
Original line number Diff line number Diff line
@@ -153,16 +153,6 @@ public class ToggleButton extends CompoundButton {
        }
    }

    @Override
    public void onPopulateAccessibilityEvent(AccessibilityEvent event) {
        super.onPopulateAccessibilityEvent(event);
        if (isChecked()) {
            event.getText().add(mContext.getString(R.string.togglebutton_pressed));
        } else {
            event.getText().add(mContext.getString(R.string.togglebutton_not_pressed));
        }
    }

    @Override
    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
        super.onInitializeAccessibilityEvent(event);
+0 −24
Original line number Diff line number Diff line
@@ -3194,30 +3194,6 @@
    <!-- Description of the button to decrement the DatePicker's year value. [CHAR LIMIT=NONE] -->
    <string name="date_picker_decrement_year_button">Decrement year</string>

    <!-- CheckBox - accessibility support -->
    <!-- Description of the checked state of a CheckBox. [CHAR LIMIT=NONE] -->
    <string name="checkbox_checked">checked</string>
    <!-- Description of the not checked state of a CheckBox. [CHAR LIMIT=NONE] -->
    <string name="checkbox_not_checked">not checked</string>

    <!-- RadioButton/CheckedTextView - accessibility support -->
    <!-- Description of the selected state of a RadioButton. [CHAR LIMIT=NONE] -->
    <string name="radiobutton_selected">selected</string>
    <!-- Description of the not selected state of a RadioButton. [CHAR LIMIT=NONE] -->
    <string name="radiobutton_not_selected">not selected</string>

    <!-- Switch - accessibility support -->
    <!-- Description of the on state of a Switch. [CHAR LIMIT=NONE] -->
    <string name="switch_on">on</string>
    <!-- Description of the off state of a Switch. [CHAR LIMIT=NONE] -->
    <string name="switch_off">off</string>

    <!-- ToggleButton - accessibility support -->
    <!-- Description of the pressed state of a ToggleButton. [CHAR LIMIT=NONE] -->
    <string name="togglebutton_pressed">pressed</string>
    <!-- Description of the not pressed state of a ToggleButton. [CHAR LIMIT=NONE] -->
    <string name="togglebutton_not_pressed">not pressed</string>

    <!-- KeyboardView - accessibility support -->
    <!-- Description of the Alt button in a KeyboardView. [CHAR LIMIT=NONE] -->
    <string name="keyboardview_keycode_alt">Alt</string>