Merge "Update view#sendAccessibilityEvent(int eventType) doc"

This commit is contained in:
Yinglei Wang
2021-08-21 00:34:07 +00:00
committed by Android (Google) Code Review

View File

@@ -8204,7 +8204,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* to populate information about the event source (this View), then calls
* {@link #dispatchPopulateAccessibilityEvent(AccessibilityEvent)} to
* populate the text content of the event source including its descendants,
* and last calls
* then for events type {@link AccessibilityEvent#TYPE_VIEW_SCROLLED}
* and {@link AccessibilityEvent#TYPE_WINDOW_CONTENT_CHANGED} with
* subtype {@link AccessibilityEvent#CONTENT_CHANGE_TYPE_STATE_DESCRIPTION},
* throttle the events, and last calls
* {@link ViewParent#requestSendAccessibilityEvent(View, AccessibilityEvent)}
* on its parent to request sending of the event to interested parties.
* <p>
@@ -8213,11 +8216,19 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* {@link AccessibilityDelegate#sendAccessibilityEvent(View, int)} is
* responsible for handling this call.
* </p>
* <p>
* If this view uses {@link AccessibilityNodeProvider} to provide virtual view hierarchy rooted
* at this view, this method should not be called to send events from virtual children because
* it will populate the events with wrong information and the events should be throttled per
* child instead at the virtual root level. To send events from virtual children, call
* {@link ViewParent#requestSendAccessibilityEvent(View, AccessibilityEvent)} on the view's
* parent to request sending of the event to interested parties.
* </p>
*
* @param eventType The type of the event to send, as defined by several types from
* {@link android.view.accessibility.AccessibilityEvent}, such as
* {@link android.view.accessibility.AccessibilityEvent#TYPE_VIEW_CLICKED} or
* {@link android.view.accessibility.AccessibilityEvent#TYPE_VIEW_HOVER_ENTER}.
* {@link AccessibilityEvent}, such as
* {@link AccessibilityEvent#TYPE_VIEW_CLICKED} or
* {@link AccessibilityEvent#TYPE_VIEW_HOVER_ENTER}.
*
* @see #onInitializeAccessibilityEvent(AccessibilityEvent)
* @see #dispatchPopulateAccessibilityEvent(AccessibilityEvent)