From 55249c8601e04928d4e8afb17233596a3ed4e0ce Mon Sep 17 00:00:00 2001 From: Svetoslav Ganov Date: Fri, 9 Mar 2012 10:09:03 -0800 Subject: Removing checked state description text for accessibility from some widgets. 1. The framework was appending some text to convey the state of a a CheckedTextView or a RadioButton or a ToggleButton or a Switch but the checked property already conveys that information. It is responsibility of the screen reader developer to append the state text based on the checked property. This change is requested by a few screen reader developers. bug:5951683 Change-Id: Ieba6797770201155c48e37147ae375dfcb5238aa --- core/java/android/widget/Switch.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'core/java/android/widget/Switch.java') diff --git a/core/java/android/widget/Switch.java b/core/java/android/widget/Switch.java index 334b9c450ef2..56b953251008 100644 --- a/core/java/android/widget/Switch.java +++ b/core/java/android/widget/Switch.java @@ -367,17 +367,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); } } -- cgit v1.2.3