summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2012-06-05 14:46:50 -0700
committerSvetoslav Ganov <svetoslavganov@google.com>2012-06-05 14:48:58 -0700
commite47957a0bbe2164467ff6e7a566b0c9e4689cdc9 (patch)
tree3b7e214111a43302ecc6cc298e9856c43a3e01bb /core/java/android
parent1c20cc5c063bf4238309827176bb84b3e512e119 (diff)
Nodes with contentDescription should always be important for accessibility.
1. Now after setting the content description on a view we mark is as important for accessibility of the current important for accessibility mode of that view is auto. 2. Minor tweak to a touch explorer coefficient to make performing double tapping easier. bug:6615353 Change-Id: I3b477f533a3ebde85d425caf32ace5e851240f88
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/View.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 48819a115c03..7c6a7c520b52 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -3457,7 +3457,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
}
break;
case com.android.internal.R.styleable.View_contentDescription:
- mContentDescription = a.getString(attr);
+ setContentDescription(a.getString(attr));
break;
case com.android.internal.R.styleable.View_soundEffectsEnabled:
if (!a.getBoolean(attr, true)) {
@@ -5048,6 +5048,10 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
@RemotableViewMethod
public void setContentDescription(CharSequence contentDescription) {
mContentDescription = contentDescription;
+ final boolean nonEmptyDesc = contentDescription != null && contentDescription.length() > 0;
+ if (nonEmptyDesc && getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
+ setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);
+ }
}
/**