diff options
| author | Svetoslav <svetoslavganov@google.com> | 2013-04-24 01:05:38 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-04-24 01:05:38 +0000 |
| commit | 4c78306617dd67b92fdf19101c5dfde4e21172d9 (patch) | |
| tree | 09251fbfcbb2f948b0a381b084b94545d7c2970e /core/java/android/widget/TextView.java | |
| parent | 952b310280954fbe187be8464a6fa50abd19a990 (diff) | |
| parent | db7da0eb8b7d515c168d5b410764e24c9a0f9431 (diff) | |
Merge "Fixing bugs exposed when moving accessibility CTS tests to UiAutomation." into jb-mr2-dev
Diffstat (limited to 'core/java/android/widget/TextView.java')
| -rw-r--r-- | core/java/android/widget/TextView.java | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 1246051a09bf..9e3f87f447bc 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -8042,7 +8042,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener info.setEditable(true); } - if (TextUtils.isEmpty(getContentDescription()) && !TextUtils.isEmpty(mText)) { + if (!TextUtils.isEmpty(mText)) { info.addAction(AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY); info.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY); info.setMovementGranularities(AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER @@ -8051,6 +8051,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PARAGRAPH | AccessibilityNodeInfo.MOVEMENT_GRANULARITY_PAGE); } + if (isFocused()) { if (canSelectText()) { info.addAction(AccessibilityNodeInfo.ACTION_SET_SELECTION); @@ -8655,13 +8656,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener */ @Override public CharSequence getIterableTextForAccessibility() { - if (!TextUtils.isEmpty(mText)) { - if (!(mText instanceof Spannable)) { - setText(mText, BufferType.SPANNABLE); - } - return mText; + if (!(mText instanceof Spannable)) { + setText(mText, BufferType.SPANNABLE); } - return super.getIterableTextForAccessibility(); + return mText; } /** @@ -8697,13 +8695,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener */ @Override public int getAccessibilitySelectionStart() { - if (TextUtils.isEmpty(getContentDescription())) { - final int selectionStart = getSelectionStart(); - if (selectionStart >= 0) { - return selectionStart; - } - } - return ACCESSIBILITY_CURSOR_POSITION_UNDEFINED; + return getSelectionStart(); } /** @@ -8718,13 +8710,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener */ @Override public int getAccessibilitySelectionEnd() { - if (TextUtils.isEmpty(getContentDescription())) { - final int selectionEnd = getSelectionEnd(); - if (selectionEnd >= 0) { - return selectionEnd; - } - } - return ACCESSIBILITY_CURSOR_POSITION_UNDEFINED; + return getSelectionEnd(); } /** |
