diff options
author | Svetoslav <svetoslavganov@google.com> | 2014-10-09 18:40:56 -0700 |
---|---|---|
committer | Svetoslav <svetoslavganov@google.com> | 2014-10-30 16:55:53 -0700 |
commit | 6c70290ff0b20329c8f173d5c3423eb83ddc46f1 (patch) | |
tree | 87a40e17c6d5224de8370f74dd13d79a350048f5 /core/java/android/widget | |
parent | c1c86151b033a2c866c10970553b567dfb359ba9 (diff) | |
download | frameworks_base-6c70290ff0b20329c8f173d5c3423eb83ddc46f1.zip frameworks_base-6c70290ff0b20329c8f173d5c3423eb83ddc46f1.tar.gz frameworks_base-6c70290ff0b20329c8f173d5c3423eb83ddc46f1.tar.bz2 |
Adding APIs to enable apps to influence accessibility traversal.
Accessibility focus is a token that can be put on any view and is
entirely controlled by accessibility services which decide whether
to put accessibility focus on a given view and what the traversal
strategy is.
Currently accessibility service use the view tree structure for
traversal which does not always reflect the logical order and the
user experience is sub-optimal. In such cases apps should be able
to influence how they are traversed for accessibility.
This change adds the notion of an accessibilty traversal order.
If a view has next in the traversal, an accessibility service has
to traverse the content of this view before traversing the content
next one.
This change will enable accessibility service to move away from
using the view tree and use spatial location of the content while
app developers can also influence the treversal order.
bug:17319923
Change-Id: Ib67ae4577f30b2c96575c71538dc1afdea08bfd3
Diffstat (limited to 'core/java/android/widget')
-rw-r--r-- | core/java/android/widget/RemoteViews.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java index 80f364b..dd7fa18 100644 --- a/core/java/android/widget/RemoteViews.java +++ b/core/java/android/widget/RemoteViews.java @@ -2528,6 +2528,26 @@ public class RemoteViews implements Parcelable, Filter { } /** + * Equivalent to calling {@link android.view.View#setAccessibilityTraversalBefore(int)}. + * + * @param viewId The id of the view whose before view in accessibility traversal to set. + * @param nextId The id of the next in the accessibility traversal. + **/ + public void setAccessibilityTraversalBefore(int viewId, int nextId) { + setInt(viewId, "setAccessibilityTraversalBefore", nextId); + } + + /** + * Equivalent to calling {@link android.view.View#setAccessibilityTraversalAfter(int)}. + * + * @param viewId The id of the view whose after view in accessibility traversal to set. + * @param nextId The id of the next in the accessibility traversal. + **/ + public void setAccessibilityTraversalAfter(int viewId, int nextId) { + setInt(viewId, "setAccessibilityTraversalAfter", nextId); + } + + /** * Equivalent to calling View.setLabelFor(int). * * @param viewId The id of the view whose property to set. |