19066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project/* 29066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Copyright (C) 2006 The Android Open Source Project 39066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 49066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Licensed under the Apache License, Version 2.0 (the "License"); 59066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * you may not use this file except in compliance with the License. 69066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * You may obtain a copy of the License at 79066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 89066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * http://www.apache.org/licenses/LICENSE-2.0 99066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 109066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Unless required by applicable law or agreed to in writing, software 119066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * distributed under the License is distributed on an "AS IS" BASIS, 129066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 139066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * See the License for the specific language governing permissions and 149066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * limitations under the License. 159066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 169066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectpackage android.view; 189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 199066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.graphics.Rect; 20b6ab098bad4b126eaaaa3aaa5a512fefc4e0749bAdam Powellimport android.os.Bundle; 21736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganovimport android.view.accessibility.AccessibilityEvent; 229066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 239066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project/** 249066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Defines the responsibilities for a class that will be a parent of a View. 259066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * This is the API that a view sees when it wants to interact with its parent. 269066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 279066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 289066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectpublic interface ViewParent { 299066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 309066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Called when something has changed which has invalidated the layout of a 319066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * child of this view parent. This will schedule a layout pass of the view 329066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * tree. 339066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 349066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public void requestLayout(); 359066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 369066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 379066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Indicates whether layout was requested on this view parent. 389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @return true if layout was requested, false otherwise 409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public boolean isLayoutRequested(); 429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Called when a child wants the view hierarchy to gather and report 459066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * transparent regions to the window compositor. Views that "punch" holes in 469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * the view hierarchy, such as SurfaceView can use this API to improve 479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * performance of the system. When no such a view is present in the 489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * hierarchy, this optimization in unnecessary and might slightly reduce the 499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * view hierarchy performance. 509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @param child the view requesting the transparent region computation 529066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 539066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public void requestTransparentRegion(View child); 559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 569066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * All or part of a child is dirty and needs to be redrawn. 589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @param child The child which is dirty 609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @param r The area within the child that is invalid 619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public void invalidateChild(View child, Rect r); 639066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 649066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 659066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * All or part of a child is dirty and needs to be redrawn. 669066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 67cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * <p>The location array is an array of two int values which respectively 68cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * define the left and the top position of the dirty child.</p> 699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 70cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * <p>This method must return the parent of this ViewParent if the specified 719066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * rectangle must be invalidated in the parent. If the specified rectangle 729066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * does not require invalidation in the parent or if the parent does not 73cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * exist, this method must return null.</p> 749066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 75cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * <p>When this method returns a non-null value, the location array must 76cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * have been updated with the left and top coordinates of this ViewParent.</p> 779066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 789066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @param location An array of 2 ints containing the left and top 799066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * coordinates of the child to invalidate 809066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @param r The area within the child that is invalid 819066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 829066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @return the parent of this ViewParent or null 839066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 849066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public ViewParent invalidateChildInParent(int[] location, Rect r); 859066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 869066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 879066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Returns the parent if it exists, or null. 889066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 899066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @return a ViewParent or null if this ViewParent does not have a parent 909066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 919066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public ViewParent getParent(); 929066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 939066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 949066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Called when a child of this parent wants focus 959066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 969066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @param child The child of this ViewParent that wants focus. This view 979066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * will contain the focused view. It is not necessarily the view that 989066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * actually has focus. 999066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @param focused The view that is a descendant of child that actually has 1009066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * focus 1019066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1029066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public void requestChildFocus(View child, View focused); 1039066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 1049066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 1059066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Tell view hierarchy that the global view attributes need to be 1069066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * re-evaluated. 1079066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 1089066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @param child View whose attributes have changed. 1099066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1109066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public void recomputeViewAttributes(View child); 1119066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 1129066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 1139066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Called when a child of this parent is giving up focus 1149066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 1159066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @param child The view that is giving up focus 1169066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public void clearChildFocus(View child); 1189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 119cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne /** 120cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * Compute the visible part of a rectangular region defined in terms of a child view's 121cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * coordinates. 122cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * 123cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * <p>Returns the clipped visible part of the rectangle <code>r</code>, defined in the 124cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * <code>child</code>'s local coordinate system. <code>r</code> is modified by this method to 125cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * contain the result, expressed in the global (root) coordinate system.</p> 126cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * 127cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * <p>The resulting rectangle is always axis aligned. If a rotation is applied to a node in the 128cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * View hierarchy, the result is the axis-aligned bounding box of the visible rectangle.</p> 129cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * 130cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * @param child A child View, whose rectangular visible region we want to compute 131cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * @param r The input rectangle, defined in the child coordinate system. Will be overwritten to 132cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * contain the resulting visible rectangle, expressed in global (root) coordinates 133cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * @param offset The input coordinates of a point, defined in the child coordinate system. 134cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * As with the <code>r</code> parameter, this will be overwritten to contain the global (root) 135cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * coordinates of that point. 136cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * A <code>null</code> value is valid (in case you are not interested in this result) 137cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * @return true if the resulting rectangle is not empty, false otherwise 138cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne */ 1399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public boolean getChildVisibleRect(View child, Rect r, android.graphics.Point offset); 1409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 1419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 1429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Find the nearest view in the specified direction that wants to take focus 1439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 1449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @param v The view that currently has focus 1459066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @param direction One of FOCUS_UP, FOCUS_DOWN, FOCUS_LEFT, and FOCUS_RIGHT 1469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public View focusSearch(View v, int direction); 1489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 1499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 1500187a5d424c8618709b8f11dd7200caa0178c40eChet Haase * Change the z order of the child so it's on top of all other children. 1510187a5d424c8618709b8f11dd7200caa0178c40eChet Haase * This ordering change may affect layout, if this container 152cb96db8d144a01aa41ec396247c548d8aa496131Chet Haase * uses an order-dependent layout scheme (e.g., LinearLayout). Prior 153e8222dddaf2e3da14380101e818d4254899e0c0dChet Haase * to {@link android.os.Build.VERSION_CODES#KITKAT} this 1540187a5d424c8618709b8f11dd7200caa0178c40eChet Haase * method should be followed by calls to {@link #requestLayout()} and 155cb96db8d144a01aa41ec396247c548d8aa496131Chet Haase * {@link View#invalidate()} on this parent to force the parent to redraw 156cb96db8d144a01aa41ec396247c548d8aa496131Chet Haase * with the new child ordering. 1579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 1580187a5d424c8618709b8f11dd7200caa0178c40eChet Haase * @param child The child to bring to the top of the z order 1599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public void bringChildToFront(View child); 1619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 1629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 1639066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Tells the parent that a new focusable view has become available. This is 1649066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * to handle transitions from the case where there are no focusable views to 1659066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * the case where the first focusable view appears. 1669066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 1679066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @param v The view that has become newly focusable 1689066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public void focusableViewAvailable(View v); 1709066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 1719066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 172021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * Shows the context menu for the specified view or its ancestors. 173021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * <p> 174021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * In most cases, a subclass does not need to override this. However, if 1759066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * the subclass is added directly to the window manager (for example, 1769066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link ViewManager#addView(View, android.view.ViewGroup.LayoutParams)}) 177021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * then it should override this and show the context menu. 178021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * 179021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * @param originalView the source view where the context menu was first 180021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * invoked 181021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * @return {@code true} if the context menu was shown, {@code false} 182021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * otherwise 183021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * @see #showContextMenuForChild(View, float, float) 1849066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1859066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public boolean showContextMenuForChild(View originalView); 1869066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 1879066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 188021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * Shows the context menu for the specified view or its ancestors anchored 189021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * to the specified view-relative coordinate. 190021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * <p> 191021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * In most cases, a subclass does not need to override this. However, if 192021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * the subclass is added directly to the window manager (for example, 193021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * {@link ViewManager#addView(View, android.view.ViewGroup.LayoutParams)}) 194021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * then it should override this and show the context menu. 1952af189a0a7962501b808cd50499d978a7cd10d81Adam Powell * <p> 1962af189a0a7962501b808cd50499d978a7cd10d81Adam Powell * If a subclass overrides this method it should also override 1972af189a0a7962501b808cd50499d978a7cd10d81Adam Powell * {@link #showContextMenuForChild(View)}. 198ed3912692f0ba8a647d795462e20fcdb67adbacbOren Blasberg * 199021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * @param originalView the source view where the context menu was first 200021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * invoked 201021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * @param x the X coordinate in pixels relative to the original view to 20223e282d297193655ce5a4b716312f0a985b27d50Oren Blasberg * which the menu should be anchored, or {@link Float#NaN} to 20323e282d297193655ce5a4b716312f0a985b27d50Oren Blasberg * disable anchoring 204021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * @param y the Y coordinate in pixels relative to the original view to 20523e282d297193655ce5a4b716312f0a985b27d50Oren Blasberg * which the menu should be anchored, or {@link Float#NaN} to 20623e282d297193655ce5a4b716312f0a985b27d50Oren Blasberg * disable anchoring 207021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * @return {@code true} if the context menu was shown, {@code false} 208021627eb5875372dea57ba91fa782fffbfbbc559Alan Viverette * otherwise 209ed3912692f0ba8a647d795462e20fcdb67adbacbOren Blasberg */ 2102af189a0a7962501b808cd50499d978a7cd10d81Adam Powell boolean showContextMenuForChild(View originalView, float x, float y); 211ed3912692f0ba8a647d795462e20fcdb67adbacbOren Blasberg 212ed3912692f0ba8a647d795462e20fcdb67adbacbOren Blasberg /** 2139066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Have the parent populate the specified context menu if it has anything to 2149066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * add (and then recurse on its parent). 2159066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 2169066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @param menu The menu to populate 2179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 2189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public void createContextMenu(ContextMenu menu); 2199066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 2209066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 2214423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri * Start an action mode for the specified view with the default type 2224423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri * {@link ActionMode#TYPE_PRIMARY}. 223cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * 224cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * <p>In most cases, a subclass does not need to override this. However, if the 2256e34636749217654f43221885afb7a29bb5ca96aAdam Powell * subclass is added directly to the window manager (for example, 2266e34636749217654f43221885afb7a29bb5ca96aAdam Powell * {@link ViewManager#addView(View, android.view.ViewGroup.LayoutParams)}) 227cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * then it should override this and start the action mode.</p> 2286e34636749217654f43221885afb7a29bb5ca96aAdam Powell * 2296e34636749217654f43221885afb7a29bb5ca96aAdam Powell * @param originalView The source view where the action mode was first invoked 2306e34636749217654f43221885afb7a29bb5ca96aAdam Powell * @param callback The callback that will handle lifecycle events for the action mode 2316e34636749217654f43221885afb7a29bb5ca96aAdam Powell * @return The new action mode if it was started, null otherwise 2324423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri * 2334423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri * @see #startActionModeForChild(View, android.view.ActionMode.Callback, int) 2346e34636749217654f43221885afb7a29bb5ca96aAdam Powell */ 2356e34636749217654f43221885afb7a29bb5ca96aAdam Powell public ActionMode startActionModeForChild(View originalView, ActionMode.Callback callback); 2366e34636749217654f43221885afb7a29bb5ca96aAdam Powell 2376e34636749217654f43221885afb7a29bb5ca96aAdam Powell /** 2384423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri * Start an action mode of a specific type for the specified view. 2394423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri * 2404423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri * <p>In most cases, a subclass does not need to override this. However, if the 2414423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri * subclass is added directly to the window manager (for example, 2424423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri * {@link ViewManager#addView(View, android.view.ViewGroup.LayoutParams)}) 2434423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri * then it should override this and start the action mode.</p> 2444423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri * 2454423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri * @param originalView The source view where the action mode was first invoked 2464423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri * @param callback The callback that will handle lifecycle events for the action mode 2474423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri * @param type One of {@link ActionMode#TYPE_PRIMARY} or {@link ActionMode#TYPE_FLOATING}. 2484423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri * @return The new action mode if it was started, null otherwise 2494423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri */ 2504423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri public ActionMode startActionModeForChild( 2514423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri View originalView, ActionMode.Callback callback, int type); 2524423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri 2534423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri /** 2549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * This method is called on the parent when a child's drawable state 2559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * has changed. 2569066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 2579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @param child The child whose drawable state has changed. 2589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 2599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public void childDrawableStateChanged(View child); 2604423d91de5300d3fd318bf5bc2d4d7e5bb856abfClara Bayarri 2619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 2629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Called when a child does not want this parent and its ancestors to 2639066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * intercept touch events with 2649066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link ViewGroup#onInterceptTouchEvent(MotionEvent)}. 265cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * 266cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * <p>This parent should pass this call onto its parents. This parent must obey 2679066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * this request for the duration of the touch (that is, only clear the flag 268cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * after this parent has received an up or a cancel.</p> 2699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 2709066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @param disallowIntercept True if the child does not want the parent to 2719066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * intercept touch events. 2729066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 2739066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public void requestDisallowInterceptTouchEvent(boolean disallowIntercept); 274d62d5e9accc76952d737f9c58a97f898807713e5Yigit Boyar 2759066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 2769066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Called when a child of this group wants a particular rectangle to be 2779066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * positioned onto the screen. {@link ViewGroup}s overriding this can trust 2789066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * that: 2799066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * <ul> 2809066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * <li>child will be a direct child of this group</li> 281d62d5e9accc76952d737f9c58a97f898807713e5Yigit Boyar * <li>rectangle will be in the child's content coordinates</li> 2829066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * </ul> 2839066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 2849066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * <p>{@link ViewGroup}s overriding this should uphold the contract:</p> 2859066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * <ul> 2869066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * <li>nothing will change if the rectangle is already visible</li> 2879066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * <li>the view port will be scrolled only just enough to make the 2889066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * rectangle visible</li> 2899066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * <ul> 2909066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 2919066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @param child The direct child making the request. 2929066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @param rectangle The rectangle in the child's coordinates the child 2939066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * wishes to be on the screen. 2949066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @param immediate True to forbid animated or delayed scrolling, 2959066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * false otherwise 2969066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @return Whether the group scrolled to handle the operation 2979066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 2989066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public boolean requestChildRectangleOnScreen(View child, Rect rectangle, 2999066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project boolean immediate); 300736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov 301736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov /** 302736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * Called by a child to request from its parent to send an {@link AccessibilityEvent}. 303736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * The child has already populated a record for itself in the event and is delegating 304736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * to its parent to send the event. The parent can optionally add a record for itself. 305736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * <p> 306736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * Note: An accessibility event is fired by an individual view which populates the 307736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * event with a record for its state and requests from its parent to perform 308736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * the sending. The parent can optionally add a record for itself before 309736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * dispatching the request to its parent. A parent can also choose not to 310736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * respect the request for sending the event. The accessibility event is sent 311cea45132e3d5d32a6fc737abf10b8893a50f465bGilles Debunne * by the topmost view in the view tree.</p> 312736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * 313736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * @param child The child which requests sending the event. 314736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * @param event The event to be sent. 315736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * @return True if the event was sent. 316736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov */ 317736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov public boolean requestSendAccessibilityEvent(View child, AccessibilityEvent event); 318539ee8716b4f81260bab2e9f3dc5d88d81c99985Adam Powell 319539ee8716b4f81260bab2e9f3dc5d88d81c99985Adam Powell /** 320539ee8716b4f81260bab2e9f3dc5d88d81c99985Adam Powell * Called when a child view now has or no longer is tracking transient state. 321539ee8716b4f81260bab2e9f3dc5d88d81c99985Adam Powell * 3220da4a282eec40364d54f9e658632c5aab85142b7Adam Powell * <p>"Transient state" is any state that a View might hold that is not expected to 3230da4a282eec40364d54f9e658632c5aab85142b7Adam Powell * be reflected in the data model that the View currently presents. This state only 3240da4a282eec40364d54f9e658632c5aab85142b7Adam Powell * affects the presentation to the user within the View itself, such as the current 3250da4a282eec40364d54f9e658632c5aab85142b7Adam Powell * state of animations in progress or the state of a text selection operation.</p> 3260da4a282eec40364d54f9e658632c5aab85142b7Adam Powell * 3270da4a282eec40364d54f9e658632c5aab85142b7Adam Powell * <p>Transient state is useful for hinting to other components of the View system 3280da4a282eec40364d54f9e658632c5aab85142b7Adam Powell * that a particular view is tracking something complex but encapsulated. 3290da4a282eec40364d54f9e658632c5aab85142b7Adam Powell * A <code>ListView</code> for example may acknowledge that list item Views 3300da4a282eec40364d54f9e658632c5aab85142b7Adam Powell * with transient state should be preserved within their position or stable item ID 3310da4a282eec40364d54f9e658632c5aab85142b7Adam Powell * instead of treating that view as trivially replaceable by the backing adapter. 3320da4a282eec40364d54f9e658632c5aab85142b7Adam Powell * This allows adapter implementations to be simpler instead of needing to track 3330da4a282eec40364d54f9e658632c5aab85142b7Adam Powell * the state of item view animations in progress such that they could be restored 3340da4a282eec40364d54f9e658632c5aab85142b7Adam Powell * in the event of an unexpected recycling and rebinding of attached item views.</p> 3350da4a282eec40364d54f9e658632c5aab85142b7Adam Powell * 3360da4a282eec40364d54f9e658632c5aab85142b7Adam Powell * <p>This method is called on a parent view when a child view or a view within 3370da4a282eec40364d54f9e658632c5aab85142b7Adam Powell * its subtree begins or ends tracking of internal transient state.</p> 3380da4a282eec40364d54f9e658632c5aab85142b7Adam Powell * 339539ee8716b4f81260bab2e9f3dc5d88d81c99985Adam Powell * @param child Child view whose state has changed 340539ee8716b4f81260bab2e9f3dc5d88d81c99985Adam Powell * @param hasTransientState true if this child has transient state 341539ee8716b4f81260bab2e9f3dc5d88d81c99985Adam Powell */ 342539ee8716b4f81260bab2e9f3dc5d88d81c99985Adam Powell public void childHasTransientStateChanged(View child, boolean hasTransientState); 3433a3a6cfd8ec12208ca75c0d0d871d19d76c34194Dianne Hackborn 3443a3a6cfd8ec12208ca75c0d0d871d19d76c34194Dianne Hackborn /** 3453a3a6cfd8ec12208ca75c0d0d871d19d76c34194Dianne Hackborn * Ask that a new dispatch of {@link View#fitSystemWindows(Rect) 3463a3a6cfd8ec12208ca75c0d0d871d19d76c34194Dianne Hackborn * View.fitSystemWindows(Rect)} be performed. 3473a3a6cfd8ec12208ca75c0d0d871d19d76c34194Dianne Hackborn */ 3483a3a6cfd8ec12208ca75c0d0d871d19d76c34194Dianne Hackborn public void requestFitSystemWindows(); 3494213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov 3504213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov /** 3514213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov * Gets the parent of a given View for accessibility. Since some Views are not 3524213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov * exposed to the accessibility layer the parent for accessibility is not 3534213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov * necessarily the direct parent of the View, rather it is a predecessor. 3544213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov * 3554213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov * @return The parent or <code>null</code> if no such is found. 3564213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov */ 3574213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov public ViewParent getParentForAccessibility(); 3584213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov 3594213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov /** 36077e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * Notifies a view parent that the accessibility state of one of its 36177e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * descendants has changed and that the structure of the subtree is 36277e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * different. 36377e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * @param child The direct child whose subtree has changed. 36477e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * @param source The descendant view that changed. 36577e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * @param changeType A bit mask of the types of changes that occurred. One 36677e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * or more of: 36777e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * <ul> 36877e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * <li>{@link AccessibilityEvent#CONTENT_CHANGE_TYPE_CONTENT_DESCRIPTION} 36977e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * <li>{@link AccessibilityEvent#CONTENT_CHANGE_TYPE_SUBTREE} 37077e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * <li>{@link AccessibilityEvent#CONTENT_CHANGE_TYPE_TEXT} 37177e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * <li>{@link AccessibilityEvent#CONTENT_CHANGE_TYPE_UNDEFINED} 37277e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * </ul> 3734213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov */ 37477e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette public void notifySubtreeAccessibilityStateChanged(View child, View source, int changeType); 3759dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio 3769dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio /** 3779dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * Tells if this view parent can resolve the layout direction. 3789dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * See {@link View#setLayoutDirection(int)} 3799dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * 3809dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * @return True if this view parent can resolve the layout direction. 3819dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio */ 3829dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio public boolean canResolveLayoutDirection(); 3839dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio 3849dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio /** 3859dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * Tells if this view parent layout direction is resolved. 3869dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * See {@link View#setLayoutDirection(int)} 3879dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * 3889dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * @return True if this view parent layout direction is resolved. 3899dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio */ 3909dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio public boolean isLayoutDirectionResolved(); 3919dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio 3929dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio /** 3939dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * Return this view parent layout direction. See {@link View#getLayoutDirection()} 3949dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * 3959dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * @return {@link View#LAYOUT_DIRECTION_RTL} if the layout direction is RTL or returns 3969dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * {@link View#LAYOUT_DIRECTION_LTR} if the layout direction is not RTL. 3979dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio */ 3989dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio public int getLayoutDirection(); 3999dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio 4009dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio /** 4019dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * Tells if this view parent can resolve the text direction. 4029dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * See {@link View#setTextDirection(int)} 4039dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * 4049dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * @return True if this view parent can resolve the text direction. 4059dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio */ 4069dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio public boolean canResolveTextDirection(); 4079dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio 4089dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio /** 4099dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * Tells if this view parent text direction is resolved. 4109dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * See {@link View#setTextDirection(int)} 4119dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * 4129dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * @return True if this view parent text direction is resolved. 4139dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio */ 4149dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio public boolean isTextDirectionResolved(); 4159dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio 4169dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio /** 4179dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * Return this view parent text direction. See {@link View#getTextDirection()} 4189dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * 4199dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * @return the resolved text direction. Returns one of: 4209dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * 4219dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * {@link View#TEXT_DIRECTION_FIRST_STRONG} 4229dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * {@link View#TEXT_DIRECTION_ANY_RTL}, 4239dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * {@link View#TEXT_DIRECTION_LTR}, 4249dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * {@link View#TEXT_DIRECTION_RTL}, 4259dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * {@link View#TEXT_DIRECTION_LOCALE} 4269dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio */ 4279dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio public int getTextDirection(); 4289dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio 4299dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio /** 4309dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * Tells if this view parent can resolve the text alignment. 4319dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * See {@link View#setTextAlignment(int)} 4329dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * 4339dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * @return True if this view parent can resolve the text alignment. 4349dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio */ 4359dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio public boolean canResolveTextAlignment(); 4369dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio 4379dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio /** 4389dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * Tells if this view parent text alignment is resolved. 4399dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * See {@link View#setTextAlignment(int)} 4409dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * 4419dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * @return True if this view parent text alignment is resolved. 4429dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio */ 4439dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio public boolean isTextAlignmentResolved(); 4449dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio 4459dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio /** 4469dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * Return this view parent text alignment. See {@link android.view.View#getTextAlignment()} 4479dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * 4489dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * @return the resolved text alignment. Returns one of: 4499dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * 4509dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * {@link View#TEXT_ALIGNMENT_GRAVITY}, 4519dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * {@link View#TEXT_ALIGNMENT_CENTER}, 4529dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * {@link View#TEXT_ALIGNMENT_TEXT_START}, 4539dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * {@link View#TEXT_ALIGNMENT_TEXT_END}, 4549dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * {@link View#TEXT_ALIGNMENT_VIEW_START}, 4559dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio * {@link View#TEXT_ALIGNMENT_VIEW_END} 4569dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio */ 4579dd4c5c6867f8b6de19096d2d68365dccb744c19Fabrice Di Meglio public int getTextAlignment(); 45810ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell 45910ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell /** 46010ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * React to a descendant view initiating a nestable scroll operation, claiming the 46110ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * nested scroll operation if appropriate. 46210ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * 46310ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * <p>This method will be called in response to a descendant view invoking 46410ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * {@link View#startNestedScroll(int)}. Each parent up the view hierarchy will be 46510ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * given an opportunity to respond and claim the nested scrolling operation by returning 46610ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * <code>true</code>.</p> 46710ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * 46810ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * <p>This method may be overridden by ViewParent implementations to indicate when the view 46910ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * is willing to support a nested scrolling operation that is about to begin. If it returns 47010ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * true, this ViewParent will become the target view's nested scrolling parent for the duration 47110ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * of the scroll operation in progress. When the nested scroll is finished this ViewParent 47210ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * will receive a call to {@link #onStopNestedScroll(View)}. 47310ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * </p> 47410ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * 47510ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * @param child Direct child of this ViewParent containing target 47610ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * @param target View that initiated the nested scroll 47710ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * @param nestedScrollAxes Flags consisting of {@link View#SCROLL_AXIS_HORIZONTAL}, 47810ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * {@link View#SCROLL_AXIS_VERTICAL} or both 47910ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * @return true if this ViewParent accepts the nested scroll operation 48010ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell */ 48110ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell public boolean onStartNestedScroll(View child, View target, int nestedScrollAxes); 48210ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell 48310ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell /** 48410ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * React to the successful claiming of a nested scroll operation. 48510ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * 48610ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * <p>This method will be called after 48710ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * {@link #onStartNestedScroll(View, View, int) onStartNestedScroll} returns true. It offers 48810ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * an opportunity for the view and its superclasses to perform initial configuration 48910ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * for the nested scroll. Implementations of this method should always call their superclass's 49010ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * implementation of this method if one is present.</p> 49110ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * 49210ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * @param child Direct child of this ViewParent containing target 49310ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * @param target View that initiated the nested scroll 49410ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * @param nestedScrollAxes Flags consisting of {@link View#SCROLL_AXIS_HORIZONTAL}, 49510ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * {@link View#SCROLL_AXIS_VERTICAL} or both 49610ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * @see #onStartNestedScroll(View, View, int) 49710ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * @see #onStopNestedScroll(View) 49810ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell */ 49910ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell public void onNestedScrollAccepted(View child, View target, int nestedScrollAxes); 50010ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell 50110ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell /** 50210ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * React to a nested scroll operation ending. 50310ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * 50410ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * <p>Perform cleanup after a nested scrolling operation. 50510ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * This method will be called when a nested scroll stops, for example when a nested touch 50610ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * scroll ends with a {@link MotionEvent#ACTION_UP} or {@link MotionEvent#ACTION_CANCEL} event. 50710ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * Implementations of this method should always call their superclass's implementation of this 50810ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * method if one is present.</p> 50910ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * 51010ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * @param target View that initiated the nested scroll 51110ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell */ 51210ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell public void onStopNestedScroll(View target); 51310ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell 51410ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell /** 51510ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * React to a nested scroll in progress. 51610ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * 51710ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * <p>This method will be called when the ViewParent's current nested scrolling child view 51810ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * dispatches a nested scroll event. To receive calls to this method the ViewParent must have 51910ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * previously returned <code>true</code> for a call to 52010ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * {@link #onStartNestedScroll(View, View, int)}.</p> 52110ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * 52210ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * <p>Both the consumed and unconsumed portions of the scroll distance are reported to the 52310ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * ViewParent. An implementation may choose to use the consumed portion to match or chase scroll 52410ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * position of multiple child elements, for example. The unconsumed portion may be used to 52510ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * allow continuous dragging of multiple scrolling or draggable elements, such as scrolling 52610ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * a list within a vertical drawer where the drawer begins dragging once the edge of inner 52710ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * scrolling content is reached.</p> 52810ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * 52910ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * @param target The descendent view controlling the nested scroll 53010ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * @param dxConsumed Horizontal scroll distance in pixels already consumed by target 53110ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * @param dyConsumed Vertical scroll distance in pixels already consumed by target 53210ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * @param dxUnconsumed Horizontal scroll distance in pixels not consumed by target 53310ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * @param dyUnconsumed Vertical scroll distance in pixels not consumed by target 53410ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell */ 53510ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell public void onNestedScroll(View target, int dxConsumed, int dyConsumed, 53610ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell int dxUnconsumed, int dyUnconsumed); 53710ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell 53810ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell /** 53910ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * React to a nested scroll in progress before the target view consumes a portion of the scroll. 54010ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * 54110ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * <p>When working with nested scrolling often the parent view may want an opportunity 54210ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * to consume the scroll before the nested scrolling child does. An example of this is a 54310ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * drawer that contains a scrollable list. The user will want to be able to scroll the list 54410ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * fully into view before the list itself begins scrolling.</p> 54510ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * 54610ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * <p><code>onNestedPreScroll</code> is called when a nested scrolling child invokes 54710ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * {@link View#dispatchNestedPreScroll(int, int, int[], int[])}. The implementation should 54810ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * report how any pixels of the scroll reported by dx, dy were consumed in the 54910ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * <code>consumed</code> array. Index 0 corresponds to dx and index 1 corresponds to dy. 55010ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * This parameter will never be null. Initial values for consumed[0] and consumed[1] 55110ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * will always be 0.</p> 55210ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * 55310ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * @param target View that initiated the nested scroll 55410ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * @param dx Horizontal scroll distance in pixels 55510ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * @param dy Vertical scroll distance in pixels 55610ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * @param consumed Output. The horizontal and vertical scroll distance consumed by this parent 55710ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell */ 55810ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell public void onNestedPreScroll(View target, int dx, int dy, int[] consumed); 55910ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell 56010ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell /** 56110ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * Request a fling from a nested scroll. 56210ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * 563b36e4f944fe28ce68182f9ec91e5341866b49084Adam Powell * <p>This method signifies that a nested scrolling child has detected suitable conditions 564b36e4f944fe28ce68182f9ec91e5341866b49084Adam Powell * for a fling. Generally this means that a touch scroll has ended with a 565b36e4f944fe28ce68182f9ec91e5341866b49084Adam Powell * {@link VelocityTracker velocity} in the direction of scrolling that meets or exceeds 566b36e4f944fe28ce68182f9ec91e5341866b49084Adam Powell * the {@link ViewConfiguration#getScaledMinimumFlingVelocity() minimum fling velocity} 567b36e4f944fe28ce68182f9ec91e5341866b49084Adam Powell * along a scrollable axis.</p> 568b36e4f944fe28ce68182f9ec91e5341866b49084Adam Powell * 56910ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * <p>If a nested scrolling child view would normally fling but it is at the edge of 570b36e4f944fe28ce68182f9ec91e5341866b49084Adam Powell * its own content, it can use this method to delegate the fling to its nested scrolling 571b36e4f944fe28ce68182f9ec91e5341866b49084Adam Powell * parent instead. The parent may optionally consume the fling or observe a child fling.</p> 57210ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * 57310ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * @param target View that initiated the nested scroll 574b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell * @param velocityX Horizontal velocity in pixels per second 57510ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell * @param velocityY Vertical velocity in pixels per second 576b36e4f944fe28ce68182f9ec91e5341866b49084Adam Powell * @param consumed true if the child consumed the fling, false otherwise 577b36e4f944fe28ce68182f9ec91e5341866b49084Adam Powell * @return true if this parent consumed or otherwise reacted to the fling 57810ba27734ee6274a772be8d6b1faa703ee3a3d6bAdam Powell */ 579b36e4f944fe28ce68182f9ec91e5341866b49084Adam Powell public boolean onNestedFling(View target, float velocityX, float velocityY, boolean consumed); 580b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell 581b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell /** 582b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell * React to a nested fling before the target view consumes it. 583b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell * 584b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell * <p>This method siginfies that a nested scrolling child has detected a fling with the given 585b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell * velocity along each axis. Generally this means that a touch scroll has ended with a 586b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell * {@link VelocityTracker velocity} in the direction of scrolling that meets or exceeds 587b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell * the {@link ViewConfiguration#getScaledMinimumFlingVelocity() minimum fling velocity} 588b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell * along a scrollable axis.</p> 589b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell * 590b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell * <p>If a nested scrolling parent is consuming motion as part of a 591b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell * {@link #onNestedPreScroll(View, int, int, int[]) pre-scroll}, it may be appropriate for 592b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell * it to also consume the pre-fling to complete that same motion. By returning 593b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell * <code>true</code> from this method, the parent indicates that the child should not 594b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell * fling its own internal content as well.</p> 595b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell * 596b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell * @param target View that initiated the nested scroll 597b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell * @param velocityX Horizontal velocity in pixels per second 598b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell * @param velocityY Vertical velocity in pixels per second 599b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell * @return true if this parent consumed the fling ahead of the target view 600b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell */ 601b72be59a6a5ca5fae3ede2470f1662598098b666Adam Powell public boolean onNestedPreFling(View target, float velocityX, float velocityY); 602b6ab098bad4b126eaaaa3aaa5a512fefc4e0749bAdam Powell 603b6ab098bad4b126eaaaa3aaa5a512fefc4e0749bAdam Powell /** 604b6ab098bad4b126eaaaa3aaa5a512fefc4e0749bAdam Powell * React to an accessibility action delegated by a target descendant view before the target 605b6ab098bad4b126eaaaa3aaa5a512fefc4e0749bAdam Powell * processes it. 606b6ab098bad4b126eaaaa3aaa5a512fefc4e0749bAdam Powell * 607b6ab098bad4b126eaaaa3aaa5a512fefc4e0749bAdam Powell * <p>This method may be called by a target descendant view if the target wishes to give 608b6ab098bad4b126eaaaa3aaa5a512fefc4e0749bAdam Powell * a view in its parent chain a chance to react to the event before normal processing occurs. 609b6ab098bad4b126eaaaa3aaa5a512fefc4e0749bAdam Powell * Most commonly this will be a scroll event such as 610b6ab098bad4b126eaaaa3aaa5a512fefc4e0749bAdam Powell * {@link android.view.accessibility.AccessibilityNodeInfo#ACTION_SCROLL_FORWARD}. 611b6ab098bad4b126eaaaa3aaa5a512fefc4e0749bAdam Powell * A ViewParent that supports acting as a nested scrolling parent should override this 612b6ab098bad4b126eaaaa3aaa5a512fefc4e0749bAdam Powell * method and act accordingly to implement scrolling via accesibility systems.</p> 613b6ab098bad4b126eaaaa3aaa5a512fefc4e0749bAdam Powell * 614b6ab098bad4b126eaaaa3aaa5a512fefc4e0749bAdam Powell * @param target The target view dispatching this action 615b6ab098bad4b126eaaaa3aaa5a512fefc4e0749bAdam Powell * @param action Action being performed; see 616b6ab098bad4b126eaaaa3aaa5a512fefc4e0749bAdam Powell * {@link android.view.accessibility.AccessibilityNodeInfo} 617b6ab098bad4b126eaaaa3aaa5a512fefc4e0749bAdam Powell * @param arguments Optional action arguments 618b6ab098bad4b126eaaaa3aaa5a512fefc4e0749bAdam Powell * @return true if the action was consumed by this ViewParent 619b6ab098bad4b126eaaaa3aaa5a512fefc4e0749bAdam Powell */ 620b6ab098bad4b126eaaaa3aaa5a512fefc4e0749bAdam Powell public boolean onNestedPrePerformAccessibilityAction(View target, int action, Bundle arguments); 6219066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project} 622