void
|
addChildrenForAccessibility(ArrayList<View> outChildren)
Adds the children of this View relevant for accessibility to the given list
as output.
|
void
|
addExtraDataToAccessibilityNodeInfo(AccessibilityNodeInfo info, String extraDataKey, Bundle arguments)
Adds extra data to an AccessibilityNodeInfo based on an explicit request for the
additional data.
|
void
|
addFocusables(ArrayList<View> views, int direction, int focusableMode)
Adds any focusable views that are descendants of this view (possibly
including this view if it is focusable itself) to views.
|
void
|
addKeyboardNavigationClusters(Collection<View> views, int direction)
Adds any keyboard navigation cluster roots that are descendants of this view (possibly
including this view if it is a cluster root itself) to views.
|
boolean
|
addStatesFromChildren()
Returns whether this ViewGroup's drawable states also include
its children's drawable states.
|
void
|
addTouchables(ArrayList<View> views)
Add any touchable views that are descendants of this view (possibly
including this view if it is touchable itself) to views.
|
void
|
addView(View child, ViewGroup.LayoutParams params)
Adds a child view with the specified layout parameters.
|
void
|
addView(View child, int index)
Adds a child view.
|
void
|
addView(View child, int index, ViewGroup.LayoutParams params)
Adds a child view with the specified layout parameters.
|
void
|
addView(View child)
Adds a child view.
|
void
|
addView(View child, int width, int height)
Adds a child view with this ViewGroup's default layout parameters and the
specified width and height.
|
boolean
|
addViewInLayout(View child, int index, ViewGroup.LayoutParams params, boolean preventRequestLayout)
Adds a view during layout.
|
boolean
|
addViewInLayout(View child, int index, ViewGroup.LayoutParams params)
Adds a view during layout.
|
void
|
attachLayoutAnimationParameters(View child, ViewGroup.LayoutParams params, int index, int count)
Subclasses should override this method to set layout animation
parameters on the supplied child.
|
void
|
attachViewToParent(View child, int index, ViewGroup.LayoutParams params)
Attaches a view to this view group.
|
void
|
bringChildToFront(View child)
Change the z order of the child so it's on top of all other children.
|
boolean
|
canAnimate()
Indicates whether the view group has the ability to animate its children
after the first layout.
|
boolean
|
checkLayoutParams(ViewGroup.LayoutParams p)
|
void
|
childDrawableStateChanged(View child)
If addStatesFromChildren() is true, refreshes this group's
drawable state (to include the states from its children).
|
void
|
childHasTransientStateChanged(View child, boolean childHasTransientState)
Called when a child view has changed whether or not it is tracking transient state.
|
void
|
cleanupLayoutState(View child)
Prevents the specified child to be laid out during the next layout pass.
|
void
|
clearChildFocus(View child)
Called when a child of this parent is giving up focus
|
void
|
clearDisappearingChildren()
Removes any pending animations for views that have been removed.
|
void
|
clearFocus()
Called when this view wants to give up focus.
|
void
|
debug(int depth)
|
void
|
detachAllViewsFromParent()
Detaches all views from the parent.
|
void
|
detachViewFromParent(int index)
Detaches a view from its parent.
|
void
|
detachViewFromParent(View child)
Detaches a view from its parent.
|
void
|
detachViewsFromParent(int start, int count)
Detaches a range of views from their parents.
|
WindowInsets
|
dispatchApplyWindowInsets(WindowInsets insets)
Request to apply the given window insets to this view or another view in its subtree.
|
boolean
|
dispatchCapturedPointerEvent(MotionEvent event)
Pass a captured pointer event down to the focused view.
|
void
|
dispatchConfigurationChanged(Configuration newConfig)
Dispatch a notification about a resource configuration change down
the view hierarchy.
|
void
|
dispatchCreateViewTranslationRequest(Map<AutofillId, long[]> viewIds, int[] supportedFormats, TranslationCapability capability, List<ViewTranslationRequest> requests)
Dispatch to collect the ViewTranslationRequest s for translation purpose by traversing
the hierarchy when the app requests ui translation.
The implementation calls dispatchCreateViewTranslationRequest(Map, int, TranslationCapability, List) for all the child
views.
|
void
|
dispatchDisplayHint(int hint)
Dispatch a hint about whether this view is displayed.
|
boolean
|
dispatchDragEvent(DragEvent event)
Detects if this View is enabled and has a drag event listener.
|
void
|
dispatchDraw(Canvas canvas)
Called by draw to draw the child views.
|
void
|
dispatchDrawableHotspotChanged(float x, float y)
Dispatches drawable hotspot changes to child views that meet at least
one of the following criteria:
|
void
|
dispatchFreezeSelfOnly(SparseArray<Parcelable> container)
Perform dispatching of a View.saveHierarchyState(android.util.SparseArray) freeze()}
to only this view, not to its children.
|
boolean
|
dispatchGenericFocusedEvent(MotionEvent event)
Dispatch a generic motion event to the currently focused view.
|
boolean
|
dispatchGenericPointerEvent(MotionEvent event)
Dispatch a generic motion event to the view under the first pointer.
|
boolean
|
dispatchHoverEvent(MotionEvent event)
Dispatch a hover event.
|
boolean
|
dispatchKeyEvent(KeyEvent event)
Dispatch a key event to the next view on the focus path.
|
boolean
|
dispatchKeyEventPreIme(KeyEvent event)
Dispatch a key event before it is processed by any input method
associated with the view hierarchy.
|
boolean
|
dispatchKeyShortcutEvent(KeyEvent event)
Dispatches a key shortcut event.
|
void
|
dispatchPointerCaptureChanged(boolean hasCapture)
|
void
|
dispatchProvideAutofillStructure(ViewStructure structure, int flags)
Dispatches creation of a ViewStructure s for autofill purposes down the hierarchy,
when an Assist structure is being created as part of an autofill request.
This implementation adds in all child views of the view group, in addition to calling the
default View implementation.
|
void
|
dispatchProvideStructure(ViewStructure structure)
Dispatch creation of ViewStructure down the hierarchy.
|
void
|
dispatchRestoreInstanceState(SparseArray<Parcelable> container)
Called by restoreHierarchyState(android.util.SparseArray) to retrieve the
state for this view and its children.
|
void
|
dispatchSaveInstanceState(SparseArray<Parcelable> container)
Called by saveHierarchyState(android.util.SparseArray) to store the state for
this view and its children.
|
void
|
dispatchScrollCaptureSearch(Rect localVisibleRect, Point windowOffset, Consumer<ScrollCaptureTarget> targets)
Handle the scroll capture search request by checking this view if applicable, then to each
child view.
|
void
|
dispatchSetActivated(boolean activated)
Dispatch setActivated to all of this View's children.
|
void
|
dispatchSetPressed(boolean pressed)
Dispatch setPressed to all of this View's children.
|
void
|
dispatchSetSelected(boolean selected)
Dispatch setSelected to all of this View's children.
|
void
|
dispatchSystemUiVisibilityChanged(int visible)
This method is deprecated.
Use WindowInsets.isVisible(int) to find out about system bar visibilities
by setting a OnApplyWindowInsetsListener on this view.
|
void
|
dispatchThawSelfOnly(SparseArray<Parcelable> container)
Perform dispatching of a View.restoreHierarchyState(android.util.SparseArray)
to only this view, not to its children.
|
boolean
|
dispatchTouchEvent(MotionEvent ev)
Pass the touch screen motion event down to the target view, or this
view if it is the target.
|
boolean
|
dispatchTrackballEvent(MotionEvent event)
Pass a trackball motion event down to the focused view.
|
boolean
|
dispatchUnhandledMove(View focused, int direction)
This method is the last chance for the focused view and its ancestors to
respond to an arrow key.
|
void
|
dispatchVisibilityChanged(View changedView, int visibility)
Dispatch a view visibility change down the view hierarchy.
|
void
|
dispatchWindowFocusChanged(boolean hasFocus)
Called when the window containing this view gains or loses window focus.
|
void
|
dispatchWindowInsetsAnimationEnd(WindowInsetsAnimation animation)
Dispatches WindowInsetsAnimation.Callback.onEnd(WindowInsetsAnimation)
when Window Insets animation ends.
|
void
|
dispatchWindowInsetsAnimationPrepare(WindowInsetsAnimation animation)
Dispatches WindowInsetsAnimation.Callback.onPrepare(WindowInsetsAnimation)
when Window Insets animation is being prepared.
|
WindowInsets
|
dispatchWindowInsetsAnimationProgress(WindowInsets insets, List<WindowInsetsAnimation> runningAnimations)
Dispatches WindowInsetsAnimation.Callback.onProgress(WindowInsets, List)
when Window Insets animation makes progress.
|
WindowInsetsAnimation.Bounds
|
dispatchWindowInsetsAnimationStart(WindowInsetsAnimation animation, WindowInsetsAnimation.Bounds bounds)
Dispatches WindowInsetsAnimation.Callback.onStart(WindowInsetsAnimation, Bounds)
when Window Insets animation is started.
|
void
|
dispatchWindowSystemUiVisiblityChanged(int visible)
This method is deprecated.
SystemUiVisibility flags are deprecated. Use WindowInsetsController
instead.
|
void
|
dispatchWindowVisibilityChanged(int visibility)
Dispatch a window visibility change down the view hierarchy.
|
boolean
|
drawChild(Canvas canvas, View child, long drawingTime)
Draw one child of this View Group.
|
void
|
drawableStateChanged()
This function is called whenever the state of the view changes in such
a way that it impacts the state of drawables being shown.
|
void
|
endViewTransition(View view)
This method should always be called following an earlier call to
startViewTransition(android.view.View) .
|
View
|
findFocus()
Find the view in the hierarchy rooted at this view that currently has
focus.
|
OnBackInvokedDispatcher
|
findOnBackInvokedDispatcherForChild(View child, View requester)
Walk up the View hierarchy to find the nearest OnBackInvokedDispatcher .
|
void
|
findViewsWithText(ArrayList<View> outViews, CharSequence text, int flags)
Finds the Views that contain given text.
|
View
|
focusSearch(View focused, int direction)
Find the nearest view in the specified direction that wants to take
focus.
|
void
|
focusableViewAvailable(View v)
Tells the parent that a new focusable view has become available.
|
boolean
|
gatherTransparentRegion(Region region)
This is used by the ViewRoot to perform an optimization when
the view hierarchy contains one or several SurfaceView.
|
ViewGroup.LayoutParams
|
generateDefaultLayoutParams()
Returns a set of default layout parameters.
|
ViewGroup.LayoutParams
|
generateLayoutParams(AttributeSet attrs)
Returns a new set of layout parameters based on the supplied attributes set.
|
ViewGroup.LayoutParams
|
generateLayoutParams(ViewGroup.LayoutParams p)
Returns a safe set of layout parameters based on the supplied layout params.
|
CharSequence
|
getAccessibilityClassName()
Return the class name of this object to be used for accessibility purposes.
|
View
|
getChildAt(int index)
Returns the view at the specified position in the group.
|
int
|
getChildCount()
Returns the number of children in the group.
|
int
|
getChildDrawingOrder(int childCount, int drawingPosition)
Converts drawing order position to container position.
|
final
int
|
getChildDrawingOrder(int drawingPosition)
Converts drawing order position to container position.
|
static
int
|
getChildMeasureSpec(int spec, int padding, int childDimension)
Does the hard part of measureChildren: figuring out the MeasureSpec to
pass to a particular child.
|
boolean
|
getChildStaticTransformation(View child, Transformation t)
Sets t to be the static transformation of the child, if set, returning a
boolean to indicate whether a static transform was set.
|
boolean
|
getChildVisibleRect(View child, Rect r, Point offset)
Compute the visible part of a rectangular region defined in terms of a child view's
coordinates.
|
boolean
|
getClipChildren()
Returns whether this group's children are clipped to their bounds before drawing.
|
boolean
|
getClipToPadding()
Returns whether this ViewGroup will clip its children to its padding, and resize (but
not clip) any EdgeEffect to the padded region, if padding is present.
|
int
|
getDescendantFocusability()
Gets the descendant focusability of this view group.
|
View
|
getFocusedChild()
Returns the focused child of this view, if any.
|
LayoutAnimationController
|
getLayoutAnimation()
Returns the layout animation controller used to animate the group's
children.
|
Animation.AnimationListener
|
getLayoutAnimationListener()
Returns the animation listener to which layout animation events are
sent.
|
int
|
getLayoutMode()
Returns the basis of alignment during layout operations on this ViewGroup:
either LAYOUT_MODE_CLIP_BOUNDS or LAYOUT_MODE_OPTICAL_BOUNDS .
|
LayoutTransition
|
getLayoutTransition()
Gets the LayoutTransition object for this ViewGroup.
|
int
|
getNestedScrollAxes()
Return the current axes of nested scrolling for this ViewGroup.
|
ViewGroupOverlay
|
getOverlay()
Returns the ViewGroupOverlay for this view group, creating it if it does
not yet exist.
|
int
|
getPersistentDrawingCache()
This method was deprecated
in API level 28.
The view drawing cache was largely made obsolete with the introduction of
hardware-accelerated rendering in API 11. With hardware-acceleration, intermediate cache
layers are largely unnecessary and can easily result in a net loss in performance due to the
cost of creating and updating the layer. In the rare cases where caching layers are useful,
such as for alpha animations, View.setLayerType(int, android.graphics.Paint) handles this with hardware
rendering. For software-rendered snapshots of a small part of the View hierarchy or
individual Views it is recommended to create a Canvas from either a Bitmap or
Picture and call View.draw(android.graphics.Canvas) on the View. However these
software-rendered usages are discouraged and have compatibility issues with hardware-only
rendering features such as Config.HARDWARE
bitmaps, real-time shadows, and outline clipping. For screenshots of the UI for feedback
reports or unit testing the PixelCopy API is recommended.
|
boolean
|
getTouchscreenBlocksFocus()
Check whether this ViewGroup should ignore focus requests for itself and its children.
|
boolean
|
hasFocus()
Returns true if this view has or contains focus
|
boolean
|
hasTransientState()
Indicates whether the view is currently tracking transient state that the
app should not need to concern itself with saving and restoring, but that
the framework should take special note to preserve when possible.
|
int
|
indexOfChild(View child)
Returns the position in the group of the specified child view.
|
final
void
|
invalidateChild(View child, Rect dirty)
This method is deprecated.
Use onDescendantInvalidated(android.view.View, android.view.View) instead to observe updates to
draw state in descendants.
|
ViewParent
|
invalidateChildInParent(int[] location, Rect dirty)
This method is deprecated.
Use onDescendantInvalidated(android.view.View, android.view.View) instead to observe updates to
draw state in descendants.
|
boolean
|
isAlwaysDrawnWithCacheEnabled()
This method was deprecated
in API level 23.
As of Build.VERSION_CODES.M , this property is ignored.
Child views may no longer have their caching behavior disabled by parents.
|
boolean
|
isAnimationCacheEnabled()
This method was deprecated
in API level 23.
As of Build.VERSION_CODES.M , this property is ignored.
Caching behavior of children may be controlled through View.setLayerType(int, Paint) .
|
boolean
|
isChildrenDrawingOrderEnabled()
Indicates whether the ViewGroup is drawing its children in the order defined by
getChildDrawingOrder(int, int) .
|
boolean
|
isChildrenDrawnWithCacheEnabled()
This method was deprecated
in API level 23.
As of Build.VERSION_CODES.M , this property is ignored.
Child views may no longer be forced to cache their rendering state by their parents.
Use View.setLayerType(int, Paint) on individual Views instead.
|
boolean
|
isLayoutSuppressed()
Returns whether layout calls on this container are currently being
suppressed, due to an earlier call to suppressLayout(boolean) .
|
boolean
|
isMotionEventSplittingEnabled()
Returns true if MotionEvents dispatched to this ViewGroup can be split to multiple children.
|
boolean
|
isTransitionGroup()
Returns true if this ViewGroup should be considered as a single entity for removal
when executing an Activity transition.
|
void
|
jumpDrawablesToCurrentState()
Call Drawable.jumpToCurrentState()
on all Drawable objects associated with this view.
|
final
void
|
layout(int l, int t, int r, int b)
Assign a size and position to a view and all of its
descendants
This is the second phase of the layout mechanism.
|
void
|
measureChild(View child, int parentWidthMeasureSpec, int parentHeightMeasureSpec)
Ask one of the children of this view to measure itself, taking into
account both the MeasureSpec requirements for this view and its padding.
|
void
|
measureChildWithMargins(View child, int parentWidthMeasureSpec, int widthUsed, int parentHeightMeasureSpec, int heightUsed)
Ask one of the children of this view to measure itself, taking into
account both the MeasureSpec requirements for this view and its padding
and margins.
|
void
|
measureChildren(int widthMeasureSpec, int heightMeasureSpec)
Ask all of the children of this view to measure themselves, taking into
account both the MeasureSpec requirements for this view and its padding.
|
void
|
notifySubtreeAccessibilityStateChanged(View child, View source, int changeType)
Notifies a view parent that the accessibility state of one of its
descendants has changed and that the structure of the subtree is
different.
|
final
void
|
offsetDescendantRectToMyCoords(View descendant, Rect rect)
Offset a rectangle that is in a descendant's coordinate
space into our coordinate space.
|
final
void
|
offsetRectIntoDescendantCoords(View descendant, Rect rect)
Offset a rectangle that is in our coordinate space into an ancestor's
coordinate space.
|
void
|
onAttachedToWindow()
This is called when the view is attached to a window.
|
int[]
|
onCreateDrawableState(int extraSpace)
Generate the new Drawable state for
this view.
|
void
|
onDescendantInvalidated(View child, View target)
The target View has been invalidated, or has had a drawing property changed that
requires the hierarchy to re-render.
If you override this method you must call through to the
superclass implementation.
|
void
|
onDetachedFromWindow()
This is called when the view is detached from a window.
|
boolean
|
onInterceptHoverEvent(MotionEvent event)
Implement this method to intercept hover events before they are handled
by child views.
|
boolean
|
onInterceptTouchEvent(MotionEvent ev)
Implement this method to intercept all touch screen motion events.
|
abstract
void
|
onLayout(boolean changed, int l, int t, int r, int b)
Called from layout when this view should
assign a size and position to each of its children.
|
boolean
|
onNestedFling(View target, float velocityX, float velocityY, boolean consumed)
Request a fling from a nested scroll.
|
boolean
|
onNestedPreFling(View target, float velocityX, float velocityY)
React to a nested fling before the target view consumes it.
|
boolean
|
onNestedPrePerformAccessibilityAction(View target, int action, Bundle args)
React to an accessibility action delegated by a target descendant view before the target
processes it.
Subclasses should always call super.onNestedPrePerformAccessibilityAction
|
void
|
onNestedPreScroll(View target, int dx, int dy, int[] consumed)
React to a nested scroll in progress before the target view consumes a portion of the scroll.
|
void
|
onNestedScroll(View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed)
React to a nested scroll in progress.
|
void
|
onNestedScrollAccepted(View child, View target, int axes)
React to the successful claiming of a nested scroll operation.
|
boolean
|
onRequestFocusInDescendants(int direction, Rect previouslyFocusedRect)
Look for a descendant to call View.requestFocus on.
|
boolean
|
onRequestSendAccessibilityEvent(View child, AccessibilityEvent event)
Called when a child has requested sending an AccessibilityEvent and
gives an opportunity to its parent to augment the event.
|
PointerIcon
|
onResolvePointerIcon(MotionEvent event, int pointerIndex)
Resolve the pointer icon that should be used for specified pointer in the motion event.
|
boolean
|
onStartNestedScroll(View child, View target, int nestedScrollAxes)
React to a descendant view initiating a nestable scroll operation, claiming the
nested scroll operation if appropriate.
|
void
|
onStopNestedScroll(View child)
React to a nested scroll operation ending.
|
void
|
onViewAdded(View child)
Called when a new child is added to this ViewGroup.
|
void
|
onViewRemoved(View child)
Called when a child view is removed from this ViewGroup.
|
void
|
propagateRequestedFrameRate(float frameRate, boolean forceOverride)
You can set the preferred frame rate for a ViewGroup and its children using a positive number
or by specifying the preferred frame rate category using constants, including
REQUESTED_FRAME_RATE_CATEGORY_NO_PREFERENCE, REQUESTED_FRAME_RATE_CATEGORY_LOW,
REQUESTED_FRAME_RATE_CATEGORY_NORMAL, REQUESTED_FRAME_RATE_CATEGORY_HIGH.
|
void
|
recomputeViewAttributes(View child)
Tell view hierarchy that the global view attributes need to be
re-evaluated.
|
void
|
removeAllViews()
Call this method to remove all child views from the
ViewGroup.
|
void
|
removeAllViewsInLayout()
Called by a ViewGroup subclass to remove child views from itself,
when it must first know its size on screen before it can calculate how many
child views it will render.
|
void
|
removeDetachedView(View child, boolean animate)
Finishes the removal of a detached view.
|
void
|
removeView(View view)
Note: do not invoke this method from
View.draw(android.graphics.Canvas) , View.onDraw(android.graphics.Canvas) ,
dispatchDraw(android.graphics.Canvas) or any related method.
|
void
|
removeViewAt(int index)
Removes the view at the specified position in the group.
|
void
|
removeViewInLayout(View view)
Removes a view during layout.
|
void
|
removeViews(int start, int count)
Removes the specified range of views from the group.
|
void
|
removeViewsInLayout(int start, int count)
Removes a range of views during layout.
|
void
|
requestChildFocus(View child, View focused)
Called when a child of this parent wants focus
|
boolean
|
requestChildRectangleOnScreen(View child, Rect rectangle, boolean immediate)
Called when a child of this group wants a particular rectangle to be
positioned onto the screen.
|
void
|
requestDisallowInterceptTouchEvent(boolean disallowIntercept)
Called when a child does not want this parent and its ancestors to
intercept touch events with
ViewGroup.onInterceptTouchEvent(MotionEvent) .
|
boolean
|
requestFocus(int direction, Rect previouslyFocusedRect)
Call this to try to give focus to a specific view or to one of its descendants
and give it hints about the direction and a specific rectangle that the focus
is coming from.
Looks for a view to give focus to respecting the setting specified by
getDescendantFocusability() .
|
boolean
|
requestSendAccessibilityEvent(View child, AccessibilityEvent event)
Called by a child to request from its parent to send an AccessibilityEvent .
|
void
|
requestTransparentRegion(View child)
Called when a child wants the view hierarchy to gather and report
transparent regions to the window compositor.
|
boolean
|
restoreDefaultFocus()
Gives focus to the default-focus view in the view hierarchy that has this view as a root.
|
void
|
scheduleLayoutAnimation()
Schedules the layout animation to be played after the next layout pass
of this view group.
|
void
|
setAddStatesFromChildren(boolean addsStates)
Sets whether this ViewGroup's drawable states also include
its children's drawable states.
|
void
|
setAlwaysDrawnWithCacheEnabled(boolean always)
This method was deprecated
in API level 23.
As of Build.VERSION_CODES.M , this property is ignored.
Child views may no longer have their caching behavior disabled by parents.
|
void
|
setAnimationCacheEnabled(boolean enabled)
This method was deprecated
in API level 23.
As of Build.VERSION_CODES.M , this property is ignored.
Caching behavior of children may be controlled through View.setLayerType(int, Paint) .
|
void
|
setChildrenDrawingCacheEnabled(boolean enabled)
This method was deprecated
in API level 28.
The view drawing cache was largely made obsolete with the introduction of
hardware-accelerated rendering in API 11. With hardware-acceleration, intermediate cache
layers are largely unnecessary and can easily result in a net loss in performance due to the
cost of creating and updating the layer. In the rare cases where caching layers are useful,
such as for alpha animations, View.setLayerType(int, android.graphics.Paint) handles this with hardware
rendering. For software-rendered snapshots of a small part of the View hierarchy or
individual Views it is recommended to create a Canvas from either a Bitmap or
Picture and call View.draw(android.graphics.Canvas) on the View. However these
software-rendered usages are discouraged and have compatibility issues with hardware-only
rendering features such as Config.HARDWARE
bitmaps, real-time shadows, and outline clipping. For screenshots of the UI for feedback
reports or unit testing the PixelCopy API is recommended.
|
void
|
setChildrenDrawingOrderEnabled(boolean enabled)
Tells the ViewGroup whether to draw its children in the order defined by the method
getChildDrawingOrder(int, int) .
|
void
|
setChildrenDrawnWithCacheEnabled(boolean enabled)
This method was deprecated
in API level 23.
As of Build.VERSION_CODES.M , this property is ignored.
Child views may no longer be forced to cache their rendering state by their parents.
Use View.setLayerType(int, Paint) on individual Views instead.
|
void
|
setClipChildren(boolean clipChildren)
By default, children are clipped to their bounds before drawing.
|
void
|
setClipToPadding(boolean clipToPadding)
Sets whether this ViewGroup will clip its children to its padding and resize (but not
clip) any EdgeEffect to the padded region, if padding is present.
|
void
|
setDescendantFocusability(int focusability)
Set the descendant focusability of this view group.
|
void
|
setLayoutAnimation(LayoutAnimationController controller)
Sets the layout animation controller used to animate the group's
children after the first layout.
|
void
|
setLayoutAnimationListener(Animation.AnimationListener animationListener)
Specifies the animation listener to which layout animation events must
be sent.
|
void
|
setLayoutMode(int layoutMode)
Sets the basis of alignment during the layout of this ViewGroup.
|
void
|
setLayoutTransition(LayoutTransition transition)
Sets the LayoutTransition object for this ViewGroup.
|
void
|
setMotionEventSplittingEnabled(boolean split)
Enable or disable the splitting of MotionEvents to multiple children during touch event
dispatch.
|
void
|
setOnHierarchyChangeListener(ViewGroup.OnHierarchyChangeListener listener)
Register a callback to be invoked when a child is added to or removed
from this view.
|
void
|
setPersistentDrawingCache(int drawingCacheToKeep)
This method was deprecated
in API level 28.
The view drawing cache was largely made obsolete with the introduction of
hardware-accelerated rendering in API 11. With hardware-acceleration, intermediate cache
layers are largely unnecessary and can easily result in a net loss in performance due to the
cost of creating and updating the layer. In the rare cases where caching layers are useful,
such as for alpha animations, View.setLayerType(int, android.graphics.Paint) handles this with hardware
rendering. For software-rendered snapshots of a small part of the View hierarchy or
individual Views it is recommended to create a Canvas from either a Bitmap or
Picture and call View.draw(android.graphics.Canvas) on the View. However these
software-rendered usages are discouraged and have compatibility issues with hardware-only
rendering features such as Config.HARDWARE
bitmaps, real-time shadows, and outline clipping. For screenshots of the UI for feedback
reports or unit testing the PixelCopy API is recommended.
|
void
|
setRequestedFrameRate(float frameRate)
You can set the preferred frame rate for a ViewGroup using a positive number
or by specifying the preferred frame rate category using constants, including
REQUESTED_FRAME_RATE_CATEGORY_NO_PREFERENCE, REQUESTED_FRAME_RATE_CATEGORY_LOW,
REQUESTED_FRAME_RATE_CATEGORY_NORMAL, REQUESTED_FRAME_RATE_CATEGORY_HIGH.
|
void
|
setStaticTransformationsEnabled(boolean enabled)
When this property is set to true, this ViewGroup supports static transformations on
children; this causes
getChildStaticTransformation(android.view.View, android.view.animation.Transformation) to be
invoked when a child is drawn.
|
void
|
setTouchscreenBlocksFocus(boolean touchscreenBlocksFocus)
Set whether this ViewGroup should ignore focus requests for itself and its children.
|
void
|
setTransitionGroup(boolean isTransitionGroup)
Changes whether or not this ViewGroup should be treated as a single entity during
Activity Transitions.
|
void
|
setWindowInsetsAnimationCallback(WindowInsetsAnimation.Callback callback)
Sets a WindowInsetsAnimation.Callback to be notified about animations of windows that
cause insets.
|
boolean
|
shouldDelayChildPressedState()
Return true if the pressed state should be delayed for children or descendants of this
ViewGroup.
|
boolean
|
showContextMenuForChild(View originalView, float x, float y)
Shows the context menu for the specified view or its ancestors anchored
to the specified view-relative coordinate.
|
boolean
|
showContextMenuForChild(View originalView)
Shows the context menu for the specified view or its ancestors.
|
ActionMode
|
startActionModeForChild(View originalView, ActionMode.Callback callback, int type)
Start an action mode of a specific type for the specified view.
|
ActionMode
|
startActionModeForChild(View originalView, ActionMode.Callback callback)
Start an action mode for the specified view with the default type
ActionMode.TYPE_PRIMARY .
|
void
|
startLayoutAnimation()
Runs the layout animation.
|
void
|
startViewTransition(View view)
This method tells the ViewGroup that the given View object, which should have this
ViewGroup as its parent,
should be kept around (re-displayed when the ViewGroup draws its children) even if it
is removed from its parent.
|
void
|
suppressLayout(boolean suppress)
Tells this ViewGroup to suppress all layout() calls until layout
suppression is disabled with a later call to suppressLayout(false).
|
void
|
updateViewLayout(View view, ViewGroup.LayoutParams params)
|