diff options
author | Adam Powell <adamp@google.com> | 2015-01-07 17:00:12 -0800 |
---|---|---|
committer | Adam Powell <adamp@google.com> | 2015-01-07 17:00:12 -0800 |
commit | b6ab098bad4b126eaaaa3aaa5a512fefc4e0749b (patch) | |
tree | 88795842ca404d4fb95c112df57d2075149b6145 /core/java/android/view/ViewParent.java | |
parent | 5a21b0c2d0fca36fbbfb32641002ad4122c6b128 (diff) | |
download | frameworks_base-b6ab098bad4b126eaaaa3aaa5a512fefc4e0749b.zip frameworks_base-b6ab098bad4b126eaaaa3aaa5a512fefc4e0749b.tar.gz frameworks_base-b6ab098bad4b126eaaaa3aaa5a512fefc4e0749b.tar.bz2 |
Add API for nested pre-processing of a11y events; fix ResolverDrawerLayout
Add API for handling nested pre-processing of accessibility events
similar to nested pre-scroll or pre-fling. This allows custom views to
delegate a nested scroll to a parent via the accessibility system.
Use this functionality to allow opening the ResolverDrawerLayout via
accessibility commands.
Bug 18827274
Change-Id: Icd5a502605b78a861bb03e7b11923841a72eb9ab
Diffstat (limited to 'core/java/android/view/ViewParent.java')
-rw-r--r-- | core/java/android/view/ViewParent.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/core/java/android/view/ViewParent.java b/core/java/android/view/ViewParent.java index 87a37f4..035871d 100644 --- a/core/java/android/view/ViewParent.java +++ b/core/java/android/view/ViewParent.java @@ -17,6 +17,7 @@ package android.view; import android.graphics.Rect; +import android.os.Bundle; import android.view.accessibility.AccessibilityEvent; /** @@ -551,4 +552,23 @@ public interface ViewParent { * @return true if this parent consumed the fling ahead of the target view */ public boolean onNestedPreFling(View target, float velocityX, float velocityY); + + /** + * React to an accessibility action delegated by a target descendant view before the target + * processes it. + * + * <p>This method may be called by a target descendant view if the target wishes to give + * a view in its parent chain a chance to react to the event before normal processing occurs. + * Most commonly this will be a scroll event such as + * {@link android.view.accessibility.AccessibilityNodeInfo#ACTION_SCROLL_FORWARD}. + * A ViewParent that supports acting as a nested scrolling parent should override this + * method and act accordingly to implement scrolling via accesibility systems.</p> + * + * @param target The target view dispatching this action + * @param action Action being performed; see + * {@link android.view.accessibility.AccessibilityNodeInfo} + * @param arguments Optional action arguments + * @return true if the action was consumed by this ViewParent + */ + public boolean onNestedPrePerformAccessibilityAction(View target, int action, Bundle arguments); } |