From b6ab098bad4b126eaaaa3aaa5a512fefc4e0749b Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Wed, 7 Jan 2015 17:00:12 -0800 Subject: 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 --- core/java/android/view/ViewGroup.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'core/java/android/view/ViewGroup.java') diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 22c5185..6678ff2 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -32,6 +32,7 @@ import android.graphics.Rect; import android.graphics.RectF; import android.graphics.Region; import android.os.Build; +import android.os.Bundle; import android.os.Parcelable; import android.os.SystemClock; import android.util.AttributeSet; @@ -2923,6 +2924,22 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager /** * {@inheritDoc} + * + *

Subclasses should always call super.onNestedPrePerformAccessibilityAction

+ * + * @param target The target view dispatching this action + * @param action Action being performed; see + * {@link android.view.accessibility.AccessibilityNodeInfo} + * @param args Optional action arguments + * @return false by default. Subclasses should return true if they handle the event. + */ + @Override + public boolean onNestedPrePerformAccessibilityAction(View target, int action, Bundle args) { + return false; + } + + /** + * {@inheritDoc} */ @Override void dispatchDetachedFromWindow() { -- cgit v1.1