From 2f4bf52d2ca1500c77b42e76f30f81f806fb6189 Mon Sep 17 00:00:00 2001 From: Svetoslav Ganov Date: Thu, 6 Sep 2012 19:07:44 -0700 Subject: [PATCH] Granular navigation not possible in edit text if the view has content description. 1. We were giving precedence of content description over text and this is what content description is supposed to do - override the text. However, putting content description on an EditText by mistake would render the text view not navigable which is pretty much unusable. Now we are giving precedence to the text and use the content description as a fall back if text is empty. bug:7078382 Change-Id: I00882ace149344478b127124bd5e641903e1b756 --- core/java/android/widget/TextView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index c9688c8524ab6..74aea76592f91 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -8355,7 +8355,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener */ @Override public CharSequence getIterableTextForAccessibility() { - if (getContentDescription() == null) { + if (!TextUtils.isEmpty(mText)) { if (!(mText instanceof Spannable)) { setText(mText, BufferType.SPANNABLE); }