1 /* 2 * Copyright (C) 2006 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.view; 18 19 import android.graphics.Rect; 20 import android.os.Bundle; 21 import android.view.accessibility.AccessibilityEvent; 22 23 /** 24 * Defines the responsibilities for a class that will be a parent of a View. 25 * This is the API that a view sees when it wants to interact with its parent. 26 * 27 */ 28 public interface ViewParent { 29 /** 30 * Called when something has changed which has invalidated the layout of a 31 * child of this view parent. This will schedule a layout pass of the view 32 * tree. 33 */ requestLayout()34 public void requestLayout(); 35 36 /** 37 * Indicates whether layout was requested on this view parent. 38 * 39 * @return true if layout was requested, false otherwise 40 */ isLayoutRequested()41 public boolean isLayoutRequested(); 42 43 /** 44 * Called when a child wants the view hierarchy to gather and report 45 * transparent regions to the window compositor. Views that "punch" holes in 46 * the view hierarchy, such as SurfaceView can use this API to improve 47 * performance of the system. When no such a view is present in the 48 * hierarchy, this optimization in unnecessary and might slightly reduce the 49 * view hierarchy performance. 50 * 51 * @param child the view requesting the transparent region computation 52 * 53 */ requestTransparentRegion(View child)54 public void requestTransparentRegion(View child); 55 56 /** 57 * All or part of a child is dirty and needs to be redrawn. 58 * 59 * @param child The child which is dirty 60 * @param r The area within the child that is invalid 61 */ invalidateChild(View child, Rect r)62 public void invalidateChild(View child, Rect r); 63 64 /** 65 * All or part of a child is dirty and needs to be redrawn. 66 * 67 * <p>The location array is an array of two int values which respectively 68 * define the left and the top position of the dirty child.</p> 69 * 70 * <p>This method must return the parent of this ViewParent if the specified 71 * rectangle must be invalidated in the parent. If the specified rectangle 72 * does not require invalidation in the parent or if the parent does not 73 * exist, this method must return null.</p> 74 * 75 * <p>When this method returns a non-null value, the location array must 76 * have been updated with the left and top coordinates of this ViewParent.</p> 77 * 78 * @param location An array of 2 ints containing the left and top 79 * coordinates of the child to invalidate 80 * @param r The area within the child that is invalid 81 * 82 * @return the parent of this ViewParent or null 83 */ invalidateChildInParent(int[] location, Rect r)84 public ViewParent invalidateChildInParent(int[] location, Rect r); 85 86 /** 87 * Returns the parent if it exists, or null. 88 * 89 * @return a ViewParent or null if this ViewParent does not have a parent 90 */ getParent()91 public ViewParent getParent(); 92 93 /** 94 * Called when a child of this parent wants focus 95 * 96 * @param child The child of this ViewParent that wants focus. This view 97 * will contain the focused view. It is not necessarily the view that 98 * actually has focus. 99 * @param focused The view that is a descendant of child that actually has 100 * focus 101 */ requestChildFocus(View child, View focused)102 public void requestChildFocus(View child, View focused); 103 104 /** 105 * Tell view hierarchy that the global view attributes need to be 106 * re-evaluated. 107 * 108 * @param child View whose attributes have changed. 109 */ recomputeViewAttributes(View child)110 public void recomputeViewAttributes(View child); 111 112 /** 113 * Called when a child of this parent is giving up focus 114 * 115 * @param child The view that is giving up focus 116 */ clearChildFocus(View child)117 public void clearChildFocus(View child); 118 119 /** 120 * Compute the visible part of a rectangular region defined in terms of a child view's 121 * coordinates. 122 * 123 * <p>Returns the clipped visible part of the rectangle <code>r</code>, defined in the 124 * <code>child</code>'s local coordinate system. <code>r</code> is modified by this method to 125 * contain the result, expressed in the global (root) coordinate system.</p> 126 * 127 * <p>The resulting rectangle is always axis aligned. If a rotation is applied to a node in the 128 * View hierarchy, the result is the axis-aligned bounding box of the visible rectangle.</p> 129 * 130 * @param child A child View, whose rectangular visible region we want to compute 131 * @param r The input rectangle, defined in the child coordinate system. Will be overwritten to 132 * contain the resulting visible rectangle, expressed in global (root) coordinates 133 * @param offset The input coordinates of a point, defined in the child coordinate system. 134 * As with the <code>r</code> parameter, this will be overwritten to contain the global (root) 135 * coordinates of that point. 136 * A <code>null</code> value is valid (in case you are not interested in this result) 137 * @return true if the resulting rectangle is not empty, false otherwise 138 */ getChildVisibleRect(View child, Rect r, android.graphics.Point offset)139 public boolean getChildVisibleRect(View child, Rect r, android.graphics.Point offset); 140 141 /** 142 * Find the nearest view in the specified direction that wants to take focus 143 * 144 * @param v The view that currently has focus 145 * @param direction One of FOCUS_UP, FOCUS_DOWN, FOCUS_LEFT, and FOCUS_RIGHT 146 */ focusSearch(View v, int direction)147 public View focusSearch(View v, int direction); 148 149 /** 150 * Change the z order of the child so it's on top of all other children. 151 * This ordering change may affect layout, if this container 152 * uses an order-dependent layout scheme (e.g., LinearLayout). Prior 153 * to {@link android.os.Build.VERSION_CODES#KITKAT} this 154 * method should be followed by calls to {@link #requestLayout()} and 155 * {@link View#invalidate()} on this parent to force the parent to redraw 156 * with the new child ordering. 157 * 158 * @param child The child to bring to the top of the z order 159 */ bringChildToFront(View child)160 public void bringChildToFront(View child); 161 162 /** 163 * Tells the parent that a new focusable view has become available. This is 164 * to handle transitions from the case where there are no focusable views to 165 * the case where the first focusable view appears. 166 * 167 * @param v The view that has become newly focusable 168 */ focusableViewAvailable(View v)169 public void focusableViewAvailable(View v); 170 171 /** 172 * Bring up a context menu for the specified view or its ancestors. 173 * 174 * <p>In most cases, a subclass does not need to override this. However, if 175 * the subclass is added directly to the window manager (for example, 176 * {@link ViewManager#addView(View, android.view.ViewGroup.LayoutParams)}) 177 * then it should override this and show the context menu.</p> 178 * 179 * @param originalView The source view where the context menu was first invoked 180 * @return true if a context menu was displayed 181 */ showContextMenuForChild(View originalView)182 public boolean showContextMenuForChild(View originalView); 183 184 /** 185 * Have the parent populate the specified context menu if it has anything to 186 * add (and then recurse on its parent). 187 * 188 * @param menu The menu to populate 189 */ createContextMenu(ContextMenu menu)190 public void createContextMenu(ContextMenu menu); 191 192 /** 193 * Start an action mode for the specified view with the default type 194 * {@link ActionMode#TYPE_PRIMARY}. 195 * 196 * <p>In most cases, a subclass does not need to override this. However, if the 197 * subclass is added directly to the window manager (for example, 198 * {@link ViewManager#addView(View, android.view.ViewGroup.LayoutParams)}) 199 * then it should override this and start the action mode.</p> 200 * 201 * @param originalView The source view where the action mode was first invoked 202 * @param callback The callback that will handle lifecycle events for the action mode 203 * @return The new action mode if it was started, null otherwise 204 * 205 * @see #startActionModeForChild(View, android.view.ActionMode.Callback, int) 206 */ startActionModeForChild(View originalView, ActionMode.Callback callback)207 public ActionMode startActionModeForChild(View originalView, ActionMode.Callback callback); 208 209 /** 210 * Start an action mode of a specific type for the specified view. 211 * 212 * <p>In most cases, a subclass does not need to override this. However, if the 213 * subclass is added directly to the window manager (for example, 214 * {@link ViewManager#addView(View, android.view.ViewGroup.LayoutParams)}) 215 * then it should override this and start the action mode.</p> 216 * 217 * @param originalView The source view where the action mode was first invoked 218 * @param callback The callback that will handle lifecycle events for the action mode 219 * @param type One of {@link ActionMode#TYPE_PRIMARY} or {@link ActionMode#TYPE_FLOATING}. 220 * @return The new action mode if it was started, null otherwise 221 */ startActionModeForChild( View originalView, ActionMode.Callback callback, int type)222 public ActionMode startActionModeForChild( 223 View originalView, ActionMode.Callback callback, int type); 224 225 /** 226 * This method is called on the parent when a child's drawable state 227 * has changed. 228 * 229 * @param child The child whose drawable state has changed. 230 */ childDrawableStateChanged(View child)231 public void childDrawableStateChanged(View child); 232 233 /** 234 * Called when a child does not want this parent and its ancestors to 235 * intercept touch events with 236 * {@link ViewGroup#onInterceptTouchEvent(MotionEvent)}. 237 * 238 * <p>This parent should pass this call onto its parents. This parent must obey 239 * this request for the duration of the touch (that is, only clear the flag 240 * after this parent has received an up or a cancel.</p> 241 * 242 * @param disallowIntercept True if the child does not want the parent to 243 * intercept touch events. 244 */ requestDisallowInterceptTouchEvent(boolean disallowIntercept)245 public void requestDisallowInterceptTouchEvent(boolean disallowIntercept); 246 247 /** 248 * Called when a child of this group wants a particular rectangle to be 249 * positioned onto the screen. {@link ViewGroup}s overriding this can trust 250 * that: 251 * <ul> 252 * <li>child will be a direct child of this group</li> 253 * <li>rectangle will be in the child's coordinates</li> 254 * </ul> 255 * 256 * <p>{@link ViewGroup}s overriding this should uphold the contract:</p> 257 * <ul> 258 * <li>nothing will change if the rectangle is already visible</li> 259 * <li>the view port will be scrolled only just enough to make the 260 * rectangle visible</li> 261 * <ul> 262 * 263 * @param child The direct child making the request. 264 * @param rectangle The rectangle in the child's coordinates the child 265 * wishes to be on the screen. 266 * @param immediate True to forbid animated or delayed scrolling, 267 * false otherwise 268 * @return Whether the group scrolled to handle the operation 269 */ requestChildRectangleOnScreen(View child, Rect rectangle, boolean immediate)270 public boolean requestChildRectangleOnScreen(View child, Rect rectangle, 271 boolean immediate); 272 273 /** 274 * Called by a child to request from its parent to send an {@link AccessibilityEvent}. 275 * The child has already populated a record for itself in the event and is delegating 276 * to its parent to send the event. The parent can optionally add a record for itself. 277 * <p> 278 * Note: An accessibility event is fired by an individual view which populates the 279 * event with a record for its state and requests from its parent to perform 280 * the sending. The parent can optionally add a record for itself before 281 * dispatching the request to its parent. A parent can also choose not to 282 * respect the request for sending the event. The accessibility event is sent 283 * by the topmost view in the view tree.</p> 284 * 285 * @param child The child which requests sending the event. 286 * @param event The event to be sent. 287 * @return True if the event was sent. 288 */ requestSendAccessibilityEvent(View child, AccessibilityEvent event)289 public boolean requestSendAccessibilityEvent(View child, AccessibilityEvent event); 290 291 /** 292 * Called when a child view now has or no longer is tracking transient state. 293 * 294 * <p>"Transient state" is any state that a View might hold that is not expected to 295 * be reflected in the data model that the View currently presents. This state only 296 * affects the presentation to the user within the View itself, such as the current 297 * state of animations in progress or the state of a text selection operation.</p> 298 * 299 * <p>Transient state is useful for hinting to other components of the View system 300 * that a particular view is tracking something complex but encapsulated. 301 * A <code>ListView</code> for example may acknowledge that list item Views 302 * with transient state should be preserved within their position or stable item ID 303 * instead of treating that view as trivially replaceable by the backing adapter. 304 * This allows adapter implementations to be simpler instead of needing to track 305 * the state of item view animations in progress such that they could be restored 306 * in the event of an unexpected recycling and rebinding of attached item views.</p> 307 * 308 * <p>This method is called on a parent view when a child view or a view within 309 * its subtree begins or ends tracking of internal transient state.</p> 310 * 311 * @param child Child view whose state has changed 312 * @param hasTransientState true if this child has transient state 313 */ childHasTransientStateChanged(View child, boolean hasTransientState)314 public void childHasTransientStateChanged(View child, boolean hasTransientState); 315 316 /** 317 * Ask that a new dispatch of {@link View#fitSystemWindows(Rect) 318 * View.fitSystemWindows(Rect)} be performed. 319 */ requestFitSystemWindows()320 public void requestFitSystemWindows(); 321 322 /** 323 * Gets the parent of a given View for accessibility. Since some Views are not 324 * exposed to the accessibility layer the parent for accessibility is not 325 * necessarily the direct parent of the View, rather it is a predecessor. 326 * 327 * @return The parent or <code>null</code> if no such is found. 328 */ getParentForAccessibility()329 public ViewParent getParentForAccessibility(); 330 331 /** 332 * Notifies a view parent that the accessibility state of one of its 333 * descendants has changed and that the structure of the subtree is 334 * different. 335 * @param child The direct child whose subtree has changed. 336 * @param source The descendant view that changed. 337 * @param changeType A bit mask of the types of changes that occurred. One 338 * or more of: 339 * <ul> 340 * <li>{@link AccessibilityEvent#CONTENT_CHANGE_TYPE_CONTENT_DESCRIPTION} 341 * <li>{@link AccessibilityEvent#CONTENT_CHANGE_TYPE_SUBTREE} 342 * <li>{@link AccessibilityEvent#CONTENT_CHANGE_TYPE_TEXT} 343 * <li>{@link AccessibilityEvent#CONTENT_CHANGE_TYPE_UNDEFINED} 344 * </ul> 345 */ notifySubtreeAccessibilityStateChanged(View child, View source, int changeType)346 public void notifySubtreeAccessibilityStateChanged(View child, View source, int changeType); 347 348 /** 349 * Tells if this view parent can resolve the layout direction. 350 * See {@link View#setLayoutDirection(int)} 351 * 352 * @return True if this view parent can resolve the layout direction. 353 */ canResolveLayoutDirection()354 public boolean canResolveLayoutDirection(); 355 356 /** 357 * Tells if this view parent layout direction is resolved. 358 * See {@link View#setLayoutDirection(int)} 359 * 360 * @return True if this view parent layout direction is resolved. 361 */ isLayoutDirectionResolved()362 public boolean isLayoutDirectionResolved(); 363 364 /** 365 * Return this view parent layout direction. See {@link View#getLayoutDirection()} 366 * 367 * @return {@link View#LAYOUT_DIRECTION_RTL} if the layout direction is RTL or returns 368 * {@link View#LAYOUT_DIRECTION_LTR} if the layout direction is not RTL. 369 */ getLayoutDirection()370 public int getLayoutDirection(); 371 372 /** 373 * Tells if this view parent can resolve the text direction. 374 * See {@link View#setTextDirection(int)} 375 * 376 * @return True if this view parent can resolve the text direction. 377 */ canResolveTextDirection()378 public boolean canResolveTextDirection(); 379 380 /** 381 * Tells if this view parent text direction is resolved. 382 * See {@link View#setTextDirection(int)} 383 * 384 * @return True if this view parent text direction is resolved. 385 */ isTextDirectionResolved()386 public boolean isTextDirectionResolved(); 387 388 /** 389 * Return this view parent text direction. See {@link View#getTextDirection()} 390 * 391 * @return the resolved text direction. Returns one of: 392 * 393 * {@link View#TEXT_DIRECTION_FIRST_STRONG} 394 * {@link View#TEXT_DIRECTION_ANY_RTL}, 395 * {@link View#TEXT_DIRECTION_LTR}, 396 * {@link View#TEXT_DIRECTION_RTL}, 397 * {@link View#TEXT_DIRECTION_LOCALE} 398 */ getTextDirection()399 public int getTextDirection(); 400 401 /** 402 * Tells if this view parent can resolve the text alignment. 403 * See {@link View#setTextAlignment(int)} 404 * 405 * @return True if this view parent can resolve the text alignment. 406 */ canResolveTextAlignment()407 public boolean canResolveTextAlignment(); 408 409 /** 410 * Tells if this view parent text alignment is resolved. 411 * See {@link View#setTextAlignment(int)} 412 * 413 * @return True if this view parent text alignment is resolved. 414 */ isTextAlignmentResolved()415 public boolean isTextAlignmentResolved(); 416 417 /** 418 * Return this view parent text alignment. See {@link android.view.View#getTextAlignment()} 419 * 420 * @return the resolved text alignment. Returns one of: 421 * 422 * {@link View#TEXT_ALIGNMENT_GRAVITY}, 423 * {@link View#TEXT_ALIGNMENT_CENTER}, 424 * {@link View#TEXT_ALIGNMENT_TEXT_START}, 425 * {@link View#TEXT_ALIGNMENT_TEXT_END}, 426 * {@link View#TEXT_ALIGNMENT_VIEW_START}, 427 * {@link View#TEXT_ALIGNMENT_VIEW_END} 428 */ getTextAlignment()429 public int getTextAlignment(); 430 431 /** 432 * React to a descendant view initiating a nestable scroll operation, claiming the 433 * nested scroll operation if appropriate. 434 * 435 * <p>This method will be called in response to a descendant view invoking 436 * {@link View#startNestedScroll(int)}. Each parent up the view hierarchy will be 437 * given an opportunity to respond and claim the nested scrolling operation by returning 438 * <code>true</code>.</p> 439 * 440 * <p>This method may be overridden by ViewParent implementations to indicate when the view 441 * is willing to support a nested scrolling operation that is about to begin. If it returns 442 * true, this ViewParent will become the target view's nested scrolling parent for the duration 443 * of the scroll operation in progress. When the nested scroll is finished this ViewParent 444 * will receive a call to {@link #onStopNestedScroll(View)}. 445 * </p> 446 * 447 * @param child Direct child of this ViewParent containing target 448 * @param target View that initiated the nested scroll 449 * @param nestedScrollAxes Flags consisting of {@link View#SCROLL_AXIS_HORIZONTAL}, 450 * {@link View#SCROLL_AXIS_VERTICAL} or both 451 * @return true if this ViewParent accepts the nested scroll operation 452 */ onStartNestedScroll(View child, View target, int nestedScrollAxes)453 public boolean onStartNestedScroll(View child, View target, int nestedScrollAxes); 454 455 /** 456 * React to the successful claiming of a nested scroll operation. 457 * 458 * <p>This method will be called after 459 * {@link #onStartNestedScroll(View, View, int) onStartNestedScroll} returns true. It offers 460 * an opportunity for the view and its superclasses to perform initial configuration 461 * for the nested scroll. Implementations of this method should always call their superclass's 462 * implementation of this method if one is present.</p> 463 * 464 * @param child Direct child of this ViewParent containing target 465 * @param target View that initiated the nested scroll 466 * @param nestedScrollAxes Flags consisting of {@link View#SCROLL_AXIS_HORIZONTAL}, 467 * {@link View#SCROLL_AXIS_VERTICAL} or both 468 * @see #onStartNestedScroll(View, View, int) 469 * @see #onStopNestedScroll(View) 470 */ onNestedScrollAccepted(View child, View target, int nestedScrollAxes)471 public void onNestedScrollAccepted(View child, View target, int nestedScrollAxes); 472 473 /** 474 * React to a nested scroll operation ending. 475 * 476 * <p>Perform cleanup after a nested scrolling operation. 477 * This method will be called when a nested scroll stops, for example when a nested touch 478 * scroll ends with a {@link MotionEvent#ACTION_UP} or {@link MotionEvent#ACTION_CANCEL} event. 479 * Implementations of this method should always call their superclass's implementation of this 480 * method if one is present.</p> 481 * 482 * @param target View that initiated the nested scroll 483 */ onStopNestedScroll(View target)484 public void onStopNestedScroll(View target); 485 486 /** 487 * React to a nested scroll in progress. 488 * 489 * <p>This method will be called when the ViewParent's current nested scrolling child view 490 * dispatches a nested scroll event. To receive calls to this method the ViewParent must have 491 * previously returned <code>true</code> for a call to 492 * {@link #onStartNestedScroll(View, View, int)}.</p> 493 * 494 * <p>Both the consumed and unconsumed portions of the scroll distance are reported to the 495 * ViewParent. An implementation may choose to use the consumed portion to match or chase scroll 496 * position of multiple child elements, for example. The unconsumed portion may be used to 497 * allow continuous dragging of multiple scrolling or draggable elements, such as scrolling 498 * a list within a vertical drawer where the drawer begins dragging once the edge of inner 499 * scrolling content is reached.</p> 500 * 501 * @param target The descendent view controlling the nested scroll 502 * @param dxConsumed Horizontal scroll distance in pixels already consumed by target 503 * @param dyConsumed Vertical scroll distance in pixels already consumed by target 504 * @param dxUnconsumed Horizontal scroll distance in pixels not consumed by target 505 * @param dyUnconsumed Vertical scroll distance in pixels not consumed by target 506 */ onNestedScroll(View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed)507 public void onNestedScroll(View target, int dxConsumed, int dyConsumed, 508 int dxUnconsumed, int dyUnconsumed); 509 510 /** 511 * React to a nested scroll in progress before the target view consumes a portion of the scroll. 512 * 513 * <p>When working with nested scrolling often the parent view may want an opportunity 514 * to consume the scroll before the nested scrolling child does. An example of this is a 515 * drawer that contains a scrollable list. The user will want to be able to scroll the list 516 * fully into view before the list itself begins scrolling.</p> 517 * 518 * <p><code>onNestedPreScroll</code> is called when a nested scrolling child invokes 519 * {@link View#dispatchNestedPreScroll(int, int, int[], int[])}. The implementation should 520 * report how any pixels of the scroll reported by dx, dy were consumed in the 521 * <code>consumed</code> array. Index 0 corresponds to dx and index 1 corresponds to dy. 522 * This parameter will never be null. Initial values for consumed[0] and consumed[1] 523 * will always be 0.</p> 524 * 525 * @param target View that initiated the nested scroll 526 * @param dx Horizontal scroll distance in pixels 527 * @param dy Vertical scroll distance in pixels 528 * @param consumed Output. The horizontal and vertical scroll distance consumed by this parent 529 */ onNestedPreScroll(View target, int dx, int dy, int[] consumed)530 public void onNestedPreScroll(View target, int dx, int dy, int[] consumed); 531 532 /** 533 * Request a fling from a nested scroll. 534 * 535 * <p>This method signifies that a nested scrolling child has detected suitable conditions 536 * for a fling. Generally this means that a touch scroll has ended with a 537 * {@link VelocityTracker velocity} in the direction of scrolling that meets or exceeds 538 * the {@link ViewConfiguration#getScaledMinimumFlingVelocity() minimum fling velocity} 539 * along a scrollable axis.</p> 540 * 541 * <p>If a nested scrolling child view would normally fling but it is at the edge of 542 * its own content, it can use this method to delegate the fling to its nested scrolling 543 * parent instead. The parent may optionally consume the fling or observe a child fling.</p> 544 * 545 * @param target View that initiated the nested scroll 546 * @param velocityX Horizontal velocity in pixels per second 547 * @param velocityY Vertical velocity in pixels per second 548 * @param consumed true if the child consumed the fling, false otherwise 549 * @return true if this parent consumed or otherwise reacted to the fling 550 */ onNestedFling(View target, float velocityX, float velocityY, boolean consumed)551 public boolean onNestedFling(View target, float velocityX, float velocityY, boolean consumed); 552 553 /** 554 * React to a nested fling before the target view consumes it. 555 * 556 * <p>This method siginfies that a nested scrolling child has detected a fling with the given 557 * velocity along each axis. Generally this means that a touch scroll has ended with a 558 * {@link VelocityTracker velocity} in the direction of scrolling that meets or exceeds 559 * the {@link ViewConfiguration#getScaledMinimumFlingVelocity() minimum fling velocity} 560 * along a scrollable axis.</p> 561 * 562 * <p>If a nested scrolling parent is consuming motion as part of a 563 * {@link #onNestedPreScroll(View, int, int, int[]) pre-scroll}, it may be appropriate for 564 * it to also consume the pre-fling to complete that same motion. By returning 565 * <code>true</code> from this method, the parent indicates that the child should not 566 * fling its own internal content as well.</p> 567 * 568 * @param target View that initiated the nested scroll 569 * @param velocityX Horizontal velocity in pixels per second 570 * @param velocityY Vertical velocity in pixels per second 571 * @return true if this parent consumed the fling ahead of the target view 572 */ onNestedPreFling(View target, float velocityX, float velocityY)573 public boolean onNestedPreFling(View target, float velocityX, float velocityY); 574 575 /** 576 * React to an accessibility action delegated by a target descendant view before the target 577 * processes it. 578 * 579 * <p>This method may be called by a target descendant view if the target wishes to give 580 * a view in its parent chain a chance to react to the event before normal processing occurs. 581 * Most commonly this will be a scroll event such as 582 * {@link android.view.accessibility.AccessibilityNodeInfo#ACTION_SCROLL_FORWARD}. 583 * A ViewParent that supports acting as a nested scrolling parent should override this 584 * method and act accordingly to implement scrolling via accesibility systems.</p> 585 * 586 * @param target The target view dispatching this action 587 * @param action Action being performed; see 588 * {@link android.view.accessibility.AccessibilityNodeInfo} 589 * @param arguments Optional action arguments 590 * @return true if the action was consumed by this ViewParent 591 */ onNestedPrePerformAccessibilityAction(View target, int action, Bundle arguments)592 public boolean onNestedPrePerformAccessibilityAction(View target, int action, Bundle arguments); 593 } 594