ViewStub  |  API reference  |  Android Developers (original) (raw)

void

[addChildrenForAccessibility](/reference/android/view/View#addChildrenForAccessibility%28java.util.ArrayList<android.view.View>%29)([ArrayList](/reference/java/util/ArrayList)<[View](/reference/android/view/View)> outChildren)

Adds the children of this View relevant for accessibility to the given list as output.

void

[addExtraDataToAccessibilityNodeInfo](/reference/android/view/View#addExtraDataToAccessibilityNodeInfo%28android.view.accessibility.AccessibilityNodeInfo,%20java.lang.String,%20android.os.Bundle%29)([AccessibilityNodeInfo](/reference/android/view/accessibility/AccessibilityNodeInfo) info, [String](/reference/java/lang/String) extraDataKey, [Bundle](/reference/android/os/Bundle) arguments)

Adds extra data to an [AccessibilityNodeInfo](/reference/android/view/accessibility/AccessibilityNodeInfo) based on an explicit request for the additional data.

void

[addFocusables](/reference/android/view/View#addFocusables%28java.util.ArrayList<android.view.View>,%20int%29)([ArrayList](/reference/java/util/ArrayList)<[View](/reference/android/view/View)> views, int direction)

Add any focusable views that are descendants of this view (possibly including this view if it is focusable itself) to views.

void

[addFocusables](/reference/android/view/View#addFocusables%28java.util.ArrayList<android.view.View>,%20int,%20int%29)([ArrayList](/reference/java/util/ArrayList)<[View](/reference/android/view/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](/reference/android/view/View#addKeyboardNavigationClusters%28java.util.Collection<android.view.View>,%20int%29)([Collection](/reference/java/util/Collection)<[View](/reference/android/view/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.

void

[addOnAttachStateChangeListener](/reference/android/view/View#addOnAttachStateChangeListener%28android.view.View.OnAttachStateChangeListener%29)([View.OnAttachStateChangeListener](/reference/android/view/View.OnAttachStateChangeListener) listener)

Add a listener for attach state changes.

void

[addOnLayoutChangeListener](/reference/android/view/View#addOnLayoutChangeListener%28android.view.View.OnLayoutChangeListener%29)([View.OnLayoutChangeListener](/reference/android/view/View.OnLayoutChangeListener) listener)

Add a listener that will be called when the bounds of the view change due to layout processing.

void

[addOnUnhandledKeyEventListener](/reference/android/view/View#addOnUnhandledKeyEventListener%28android.view.View.OnUnhandledKeyEventListener%29)([View.OnUnhandledKeyEventListener](/reference/android/view/View.OnUnhandledKeyEventListener) listener)

Adds a listener which will receive unhandled [KeyEvent](/reference/android/view/KeyEvent)s.

void

[addTouchables](/reference/android/view/View#addTouchables%28java.util.ArrayList<android.view.View>%29)([ArrayList](/reference/java/util/ArrayList)<[View](/reference/android/view/View)> views)

Add any touchable views that are descendants of this view (possibly including this view if it is touchable itself) to views.

[ViewPropertyAnimator](/reference/android/view/ViewPropertyAnimator)

[animate](/reference/android/view/View#animate%28%29)()

This method returns a ViewPropertyAnimator object, which can be used to animate specific properties on this View.

void

[announceForAccessibility](/reference/android/view/View#announceForAccessibility%28java.lang.CharSequence%29)([CharSequence](/reference/java/lang/CharSequence) text)

This method was deprecated in API level 36. Use one of the methods described in the documentation above to semantically describe UI instead of using an announcement, as accessibility services may choose to ignore events dispatched with this method.

void

[autofill](/reference/android/view/View#autofill%28android.view.autofill.AutofillValue%29)([AutofillValue](/reference/android/view/autofill/AutofillValue) value)

Automatically fills the content of this view with the value.

void

[autofill](/reference/android/view/View#autofill%28android.util.SparseArray<android.view.autofill.AutofillValue>%29)([SparseArray](/reference/android/util/SparseArray)<[AutofillValue](/reference/android/view/autofill/AutofillValue)> values)

Automatically fills the content of the virtual children within this view.

boolean

[awakenScrollBars](/reference/android/view/View#awakenScrollBars%28int,%20boolean%29)(int startDelay, boolean invalidate)

Trigger the scrollbars to draw.

boolean

[awakenScrollBars](/reference/android/view/View#awakenScrollBars%28int%29)(int startDelay)

Trigger the scrollbars to draw.

boolean

[awakenScrollBars](/reference/android/view/View#awakenScrollBars%28%29)()

Trigger the scrollbars to draw.

void

[bringToFront](/reference/android/view/View#bringToFront%28%29)()

Change the view's z order in the tree, so it's on top of other sibling views.

void

[buildDrawingCache](/reference/android/view/View#buildDrawingCache%28boolean%29)(boolean autoScale)

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, [setLayerType(int,Paint)](/reference/android/view/View#setLayerType%28int,%20android.graphics.Paint%29) 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](/reference/android/graphics/Canvas) from either a [Bitmap](/reference/android/graphics/Bitmap) or[Picture](/reference/android/graphics/Picture) and call [draw(Canvas)](/reference/android/view/View#draw%28android.graphics.Canvas%29) on the View. However these software-rendered usages are discouraged and have compatibility issues with hardware-only rendering features such as [Config.HARDWARE](/reference/android/graphics/Bitmap.Config#HARDWARE) bitmaps, real-time shadows, and outline clipping. For screenshots of the UI for feedback reports or unit testing the [PixelCopy](/reference/android/view/PixelCopy) API is recommended.

void

[buildDrawingCache](/reference/android/view/View#buildDrawingCache%28%29)()

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, [setLayerType(int,Paint)](/reference/android/view/View#setLayerType%28int,%20android.graphics.Paint%29) 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](/reference/android/graphics/Canvas) from either a [Bitmap](/reference/android/graphics/Bitmap) or[Picture](/reference/android/graphics/Picture) and call [draw(Canvas)](/reference/android/view/View#draw%28android.graphics.Canvas%29) on the View. However these software-rendered usages are discouraged and have compatibility issues with hardware-only rendering features such as [Config.HARDWARE](/reference/android/graphics/Bitmap.Config#HARDWARE) bitmaps, real-time shadows, and outline clipping. For screenshots of the UI for feedback reports or unit testing the [PixelCopy](/reference/android/view/PixelCopy) API is recommended.

void

[buildLayer](/reference/android/view/View#buildLayer%28%29)()

Forces this view's layer to be created and this view to be rendered into its layer.

boolean

[callOnClick](/reference/android/view/View#callOnClick%28%29)()

Directly call any attached OnClickListener.

boolean

[canResolveLayoutDirection](/reference/android/view/View#canResolveLayoutDirection%28%29)()

Check if layout direction resolution can be done.

boolean

[canResolveTextAlignment](/reference/android/view/View#canResolveTextAlignment%28%29)()

Check if text alignment resolution can be done.

boolean

[canResolveTextDirection](/reference/android/view/View#canResolveTextDirection%28%29)()

Check if text direction resolution can be done.

boolean

[canScrollHorizontally](/reference/android/view/View#canScrollHorizontally%28int%29)(int direction)

Check if this view can be scrolled horizontally in a certain direction.

boolean

[canScrollVertically](/reference/android/view/View#canScrollVertically%28int%29)(int direction)

Check if this view can be scrolled vertically in a certain direction.

final void

[cancelDragAndDrop](/reference/android/view/View#cancelDragAndDrop%28%29)()

Cancels an ongoing drag and drop operation.

void

[cancelLongPress](/reference/android/view/View#cancelLongPress%28%29)()

Cancels a pending long press.

final void

[cancelPendingInputEvents](/reference/android/view/View#cancelPendingInputEvents%28%29)()

Cancel any deferred high-level input events that were previously posted to the event queue.

boolean

[checkInputConnectionProxy](/reference/android/view/View#checkInputConnectionProxy%28android.view.View%29)([View](/reference/android/view/View) view)

Called by the [InputMethodManager](/reference/android/view/inputmethod/InputMethodManager) when a view who is not the current input connection target is trying to make a call on the manager.

void

[clearAnimation](/reference/android/view/View#clearAnimation%28%29)()

Cancels any animations for this view.

void

[clearFocus](/reference/android/view/View#clearFocus%28%29)()

Called when this view wants to give up focus.

void

[clearPendingCredentialRequest](/reference/android/view/View#clearPendingCredentialRequest%28%29)()

Clears the request and callback previously set through [View.setPendingCredentialRequest](/reference/android/view/View#setPendingCredentialRequest%28android.credentials.GetCredentialRequest,%20android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException>%29).

void

[clearViewTranslationCallback](/reference/android/view/View#clearViewTranslationCallback%28%29)()

Clear the [ViewTranslationCallback](/reference/android/view/translation/ViewTranslationCallback) from this view.

static int

[combineMeasuredStates](/reference/android/view/View#combineMeasuredStates%28int,%20int%29)(int curState, int newState)

Merge two states as returned by [getMeasuredState()](/reference/android/view/View#getMeasuredState%28%29).

int

[computeHorizontalScrollExtent](/reference/android/view/View#computeHorizontalScrollExtent%28%29)()

Compute the horizontal extent of the horizontal scrollbar's thumb within the horizontal range.

int

[computeHorizontalScrollOffset](/reference/android/view/View#computeHorizontalScrollOffset%28%29)()

Compute the horizontal offset of the horizontal scrollbar's thumb within the horizontal range.

int

[computeHorizontalScrollRange](/reference/android/view/View#computeHorizontalScrollRange%28%29)()

Compute the horizontal range that the horizontal scrollbar represents.

void

[computeScroll](/reference/android/view/View#computeScroll%28%29)()

Called by a parent to request that a child update its values for mScrollX and mScrollY if necessary.

[WindowInsets](/reference/android/view/WindowInsets)

[computeSystemWindowInsets](/reference/android/view/View#computeSystemWindowInsets%28android.view.WindowInsets,%20android.graphics.Rect%29)([WindowInsets](/reference/android/view/WindowInsets) in, [Rect](/reference/android/graphics/Rect) outLocalInsets)

Compute insets that should be consumed by this view and the ones that should propagate to those under it.

int

[computeVerticalScrollExtent](/reference/android/view/View#computeVerticalScrollExtent%28%29)()

Compute the vertical extent of the vertical scrollbar's thumb within the vertical range.

int

[computeVerticalScrollOffset](/reference/android/view/View#computeVerticalScrollOffset%28%29)()

Compute the vertical offset of the vertical scrollbar's thumb within the horizontal range.

int

[computeVerticalScrollRange](/reference/android/view/View#computeVerticalScrollRange%28%29)()

Compute the vertical range that the vertical scrollbar represents.

[AccessibilityNodeInfo](/reference/android/view/accessibility/AccessibilityNodeInfo)

[createAccessibilityNodeInfo](/reference/android/view/View#createAccessibilityNodeInfo%28%29)()

Returns an [AccessibilityNodeInfo](/reference/android/view/accessibility/AccessibilityNodeInfo) representing this view from the point of view of an [AccessibilityService](/reference/android/accessibilityservice/AccessibilityService).

void

[createContextMenu](/reference/android/view/View#createContextMenu%28android.view.ContextMenu%29)([ContextMenu](/reference/android/view/ContextMenu) menu)

Show the context menu for this view.

void

[destroyDrawingCache](/reference/android/view/View#destroyDrawingCache%28%29)()

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, [setLayerType(int,Paint)](/reference/android/view/View#setLayerType%28int,%20android.graphics.Paint%29) 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](/reference/android/graphics/Canvas) from either a [Bitmap](/reference/android/graphics/Bitmap) or[Picture](/reference/android/graphics/Picture) and call [draw(Canvas)](/reference/android/view/View#draw%28android.graphics.Canvas%29) on the View. However these software-rendered usages are discouraged and have compatibility issues with hardware-only rendering features such as [Config.HARDWARE](/reference/android/graphics/Bitmap.Config#HARDWARE) bitmaps, real-time shadows, and outline clipping. For screenshots of the UI for feedback reports or unit testing the [PixelCopy](/reference/android/view/PixelCopy) API is recommended.

[WindowInsets](/reference/android/view/WindowInsets)

[dispatchApplyWindowInsets](/reference/android/view/View#dispatchApplyWindowInsets%28android.view.WindowInsets%29)([WindowInsets](/reference/android/view/WindowInsets) insets)

Request to apply the given window insets to this view or another view in its subtree.

boolean

[dispatchCapturedPointerEvent](/reference/android/view/View#dispatchCapturedPointerEvent%28android.view.MotionEvent%29)([MotionEvent](/reference/android/view/MotionEvent) event)

Pass a captured pointer event down to the focused view.

void

[dispatchConfigurationChanged](/reference/android/view/View#dispatchConfigurationChanged%28android.content.res.Configuration%29)([Configuration](/reference/android/content/res/Configuration) newConfig)

Dispatch a notification about a resource configuration change down the view hierarchy.

void

[dispatchCreateViewTranslationRequest](/reference/android/view/View#dispatchCreateViewTranslationRequest%28java.util.Map<android.view.autofill.AutofillId,long[]>,%20int[],%20android.view.translation.TranslationCapability,%20java.util.List<android.view.translation.ViewTranslationRequest>%29)([Map](/reference/java/util/Map)<[AutofillId](/reference/android/view/autofill/AutofillId), long[]> viewIds, int[] supportedFormats, [TranslationCapability](/reference/android/view/translation/TranslationCapability) capability, [List](/reference/java/util/List)<[ViewTranslationRequest](/reference/android/view/translation/ViewTranslationRequest)> requests)

Dispatch to collect the [ViewTranslationRequest](/reference/android/view/translation/ViewTranslationRequest)s for translation purpose by traversing the hierarchy when the app requests ui translation.

void

[dispatchDisplayHint](/reference/android/view/View#dispatchDisplayHint%28int%29)(int hint)

Dispatch a hint about whether this view is displayed.

boolean

[dispatchDragEvent](/reference/android/view/View#dispatchDragEvent%28android.view.DragEvent%29)([DragEvent](/reference/android/view/DragEvent) event)

Detects if this View is enabled and has a drag event listener.

void

[dispatchDraw](/reference/android/view/View#dispatchDraw%28android.graphics.Canvas%29)([Canvas](/reference/android/graphics/Canvas) canvas)

Called by draw to draw the child views.

void

[dispatchDrawableHotspotChanged](/reference/android/view/View#dispatchDrawableHotspotChanged%28float,%20float%29)(float x, float y)

Dispatches drawableHotspotChanged to all of this View's children.

void

[dispatchFinishTemporaryDetach](/reference/android/view/View#dispatchFinishTemporaryDetach%28%29)()

Dispatch [onFinishTemporaryDetach()](/reference/android/view/View#onFinishTemporaryDetach%28%29) to this View and its direct children if this is a container View.

boolean

[dispatchGenericFocusedEvent](/reference/android/view/View#dispatchGenericFocusedEvent%28android.view.MotionEvent%29)([MotionEvent](/reference/android/view/MotionEvent) event)

Dispatch a generic motion event to the currently focused view.

boolean

[dispatchGenericMotionEvent](/reference/android/view/View#dispatchGenericMotionEvent%28android.view.MotionEvent%29)([MotionEvent](/reference/android/view/MotionEvent) event)

Dispatch a generic motion event.

boolean

[dispatchGenericPointerEvent](/reference/android/view/View#dispatchGenericPointerEvent%28android.view.MotionEvent%29)([MotionEvent](/reference/android/view/MotionEvent) event)

Dispatch a generic motion event to the view under the first pointer.

boolean

[dispatchHoverEvent](/reference/android/view/View#dispatchHoverEvent%28android.view.MotionEvent%29)([MotionEvent](/reference/android/view/MotionEvent) event)

Dispatch a hover event.

boolean

[dispatchKeyEvent](/reference/android/view/View#dispatchKeyEvent%28android.view.KeyEvent%29)([KeyEvent](/reference/android/view/KeyEvent) event)

Dispatch a key event to the next view on the focus path.

boolean

[dispatchKeyEventPreIme](/reference/android/view/View#dispatchKeyEventPreIme%28android.view.KeyEvent%29)([KeyEvent](/reference/android/view/KeyEvent) event)

Dispatch a key event before it is processed by any input method associated with the view hierarchy.

boolean

[dispatchKeyShortcutEvent](/reference/android/view/View#dispatchKeyShortcutEvent%28android.view.KeyEvent%29)([KeyEvent](/reference/android/view/KeyEvent) event)

Dispatches a key shortcut event.

boolean

[dispatchNestedFling](/reference/android/view/View#dispatchNestedFling%28float,%20float,%20boolean%29)(float velocityX, float velocityY, boolean consumed)

Dispatch a fling to a nested scrolling parent.

boolean

[dispatchNestedPreFling](/reference/android/view/View#dispatchNestedPreFling%28float,%20float%29)(float velocityX, float velocityY)

Dispatch a fling to a nested scrolling parent before it is processed by this view.

boolean

[dispatchNestedPrePerformAccessibilityAction](/reference/android/view/View#dispatchNestedPrePerformAccessibilityAction%28int,%20android.os.Bundle%29)(int action, [Bundle](/reference/android/os/Bundle) arguments)

Report an accessibility action to this view's parents for delegated processing.

boolean

[dispatchNestedPreScroll](/reference/android/view/View#dispatchNestedPreScroll%28int,%20int,%20int[],%20int[]%29)(int dx, int dy, int[] consumed, int[] offsetInWindow)

Dispatch one step of a nested scroll in progress before this view consumes any portion of it.

boolean

[dispatchNestedScroll](/reference/android/view/View#dispatchNestedScroll%28int,%20int,%20int,%20int,%20int[]%29)(int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int[] offsetInWindow)

Dispatch one step of a nested scroll in progress.

void

[dispatchPointerCaptureChanged](/reference/android/view/View#dispatchPointerCaptureChanged%28boolean%29)(boolean hasCapture)

boolean

[dispatchPopulateAccessibilityEvent](/reference/android/view/View#dispatchPopulateAccessibilityEvent%28android.view.accessibility.AccessibilityEvent%29)([AccessibilityEvent](/reference/android/view/accessibility/AccessibilityEvent) event)

Dispatches an [AccessibilityEvent](/reference/android/view/accessibility/AccessibilityEvent) to the [View](/reference/android/view/View) to add the text content of the view and its children.

void

[dispatchProvideAutofillStructure](/reference/android/view/View#dispatchProvideAutofillStructure%28android.view.ViewStructure,%20int%29)([ViewStructure](/reference/android/view/ViewStructure) structure, int flags)

Dispatches creation of a [ViewStructure](/reference/android/view/ViewStructure)s for autofill purposes down the hierarchy, when an Assist structure is being created as part of an autofill request.

void

[dispatchProvideStructure](/reference/android/view/View#dispatchProvideStructure%28android.view.ViewStructure%29)([ViewStructure](/reference/android/view/ViewStructure) structure)

Dispatch creation of [ViewStructure](/reference/android/view/ViewStructure) down the hierarchy.

void

[dispatchRestoreInstanceState](/reference/android/view/View#dispatchRestoreInstanceState%28android.util.SparseArray<android.os.Parcelable>%29)([SparseArray](/reference/android/util/SparseArray)<[Parcelable](/reference/android/os/Parcelable)> container)

Called by [restoreHierarchyState(android.util.SparseArray)](/reference/android/view/View#restoreHierarchyState%28android.util.SparseArray<android.os.Parcelable>%29) to retrieve the state for this view and its children.

void

[dispatchSaveInstanceState](/reference/android/view/View#dispatchSaveInstanceState%28android.util.SparseArray<android.os.Parcelable>%29)([SparseArray](/reference/android/util/SparseArray)<[Parcelable](/reference/android/os/Parcelable)> container)

Called by [saveHierarchyState(android.util.SparseArray)](/reference/android/view/View#saveHierarchyState%28android.util.SparseArray<android.os.Parcelable>%29) to store the state for this view and its children.

void

[dispatchScrollCaptureSearch](/reference/android/view/View#dispatchScrollCaptureSearch%28android.graphics.Rect,%20android.graphics.Point,%20java.util.function.Consumer<android.view.ScrollCaptureTarget>%29)([Rect](/reference/android/graphics/Rect) localVisibleRect, [Point](/reference/android/graphics/Point) windowOffset, [Consumer](/reference/java/util/function/Consumer)<[ScrollCaptureTarget](/reference/android/view/ScrollCaptureTarget)> targets)

Dispatch a scroll capture search request down the view hierarchy.

void

[dispatchSetActivated](/reference/android/view/View#dispatchSetActivated%28boolean%29)(boolean activated)

Dispatch setActivated to all of this View's children.

void

[dispatchSetPressed](/reference/android/view/View#dispatchSetPressed%28boolean%29)(boolean pressed)

Dispatch setPressed to all of this View's children.

void

[dispatchSetSelected](/reference/android/view/View#dispatchSetSelected%28boolean%29)(boolean selected)

Dispatch setSelected to all of this View's children.

void

[dispatchStartTemporaryDetach](/reference/android/view/View#dispatchStartTemporaryDetach%28%29)()

Dispatch [onStartTemporaryDetach()](/reference/android/view/View#onStartTemporaryDetach%28%29) to this View and its direct children if this is a container View.

void

[dispatchSystemUiVisibilityChanged](/reference/android/view/View#dispatchSystemUiVisibilityChanged%28int%29)(int visibility)

This method was deprecated in API level 30. Use [WindowInsets.isVisible(int)](/reference/android/view/WindowInsets#isVisible%28int%29) to find out about system bar visibilities by setting a [OnApplyWindowInsetsListener](/reference/android/view/View.OnApplyWindowInsetsListener) on this view.

boolean

[dispatchTouchEvent](/reference/android/view/View#dispatchTouchEvent%28android.view.MotionEvent%29)([MotionEvent](/reference/android/view/MotionEvent) event)

Pass the touch screen motion event down to the target view, or this view if it is the target.

boolean

[dispatchTrackballEvent](/reference/android/view/View#dispatchTrackballEvent%28android.view.MotionEvent%29)([MotionEvent](/reference/android/view/MotionEvent) event)

Pass a trackball motion event down to the focused view.

boolean

[dispatchUnhandledMove](/reference/android/view/View#dispatchUnhandledMove%28android.view.View,%20int%29)([View](/reference/android/view/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](/reference/android/view/View#dispatchVisibilityChanged%28android.view.View,%20int%29)([View](/reference/android/view/View) changedView, int visibility)

Dispatch a view visibility change down the view hierarchy.

void

[dispatchWindowFocusChanged](/reference/android/view/View#dispatchWindowFocusChanged%28boolean%29)(boolean hasFocus)

Called when the window containing this view gains or loses window focus.

void

[dispatchWindowInsetsAnimationEnd](/reference/android/view/View#dispatchWindowInsetsAnimationEnd%28android.view.WindowInsetsAnimation%29)([WindowInsetsAnimation](/reference/android/view/WindowInsetsAnimation) animation)

Dispatches [WindowInsetsAnimation.Callback.onEnd(WindowInsetsAnimation)](/reference/android/view/WindowInsetsAnimation.Callback#onEnd%28android.view.WindowInsetsAnimation%29) when Window Insets animation ends.

void

[dispatchWindowInsetsAnimationPrepare](/reference/android/view/View#dispatchWindowInsetsAnimationPrepare%28android.view.WindowInsetsAnimation%29)([WindowInsetsAnimation](/reference/android/view/WindowInsetsAnimation) animation)

Dispatches [WindowInsetsAnimation.Callback.onPrepare(WindowInsetsAnimation)](/reference/android/view/WindowInsetsAnimation.Callback#onPrepare%28android.view.WindowInsetsAnimation%29) when Window Insets animation is being prepared.

[WindowInsets](/reference/android/view/WindowInsets)

[dispatchWindowInsetsAnimationProgress](/reference/android/view/View#dispatchWindowInsetsAnimationProgress%28android.view.WindowInsets,%20java.util.List<android.view.WindowInsetsAnimation>%29)([WindowInsets](/reference/android/view/WindowInsets) insets, [List](/reference/java/util/List)<[WindowInsetsAnimation](/reference/android/view/WindowInsetsAnimation)> runningAnimations)

Dispatches [WindowInsetsAnimation.Callback.onProgress(WindowInsets,List)](/reference/android/view/WindowInsetsAnimation.Callback#onProgress%28android.view.WindowInsets,%20java.util.List<android.view.WindowInsetsAnimation>%29) when Window Insets animation makes progress.

[WindowInsetsAnimation.Bounds](/reference/android/view/WindowInsetsAnimation.Bounds)

[dispatchWindowInsetsAnimationStart](/reference/android/view/View#dispatchWindowInsetsAnimationStart%28android.view.WindowInsetsAnimation,%20android.view.WindowInsetsAnimation.Bounds%29)([WindowInsetsAnimation](/reference/android/view/WindowInsetsAnimation) animation, [WindowInsetsAnimation.Bounds](/reference/android/view/WindowInsetsAnimation.Bounds) bounds)

Dispatches [WindowInsetsAnimation.Callback.onStart(WindowInsetsAnimation,Bounds)](/reference/android/view/WindowInsetsAnimation.Callback#onStart%28android.view.WindowInsetsAnimation,%20android.view.WindowInsetsAnimation.Bounds%29) when Window Insets animation is started.

void

[dispatchWindowSystemUiVisiblityChanged](/reference/android/view/View#dispatchWindowSystemUiVisiblityChanged%28int%29)(int visible)

This method was deprecated in API level 30. SystemUiVisibility flags are deprecated. Use [WindowInsetsController](/reference/android/view/WindowInsetsController) instead.

void

[dispatchWindowVisibilityChanged](/reference/android/view/View#dispatchWindowVisibilityChanged%28int%29)(int visibility)

Dispatch a window visibility change down the view hierarchy.

void

[draw](/reference/android/view/View#draw%28android.graphics.Canvas%29)([Canvas](/reference/android/graphics/Canvas) canvas)

Manually render this view (and all of its children) to the given Canvas.

void

[drawableHotspotChanged](/reference/android/view/View#drawableHotspotChanged%28float,%20float%29)(float x, float y)

This function is called whenever the view hotspot changes and needs to be propagated to drawables or child views managed by the view.

void

[drawableStateChanged](/reference/android/view/View#drawableStateChanged%28%29)()

This function is called whenever the state of the view changes in such a way that it impacts the state of drawables being shown.

[View](/reference/android/view/View)

[findFocus](/reference/android/view/View#findFocus%28%29)()

Find the view in the hierarchy rooted at this view that currently has focus.

final[OnBackInvokedDispatcher](/reference/android/window/OnBackInvokedDispatcher)

[findOnBackInvokedDispatcher](/reference/android/view/View#findOnBackInvokedDispatcher%28%29)()

Walk up the View hierarchy to find the nearest [OnBackInvokedDispatcher](/reference/android/window/OnBackInvokedDispatcher).

final <T extends [View](/reference/android/view/View)> T

[findViewById](/reference/android/view/View#findViewById%28int%29)(int id)

Finds the first descendant view with the given ID, the view itself if the ID matches [getId()](/reference/android/view/View#getId%28%29), or null if the ID is invalid (< 0) or there is no matching view in the hierarchy.

final <T extends [View](/reference/android/view/View)> T

[findViewWithTag](/reference/android/view/View#findViewWithTag%28java.lang.Object%29)([Object](/reference/java/lang/Object) tag)

Look for a child view with the given tag.

void

[findViewsWithText](/reference/android/view/View#findViewsWithText%28java.util.ArrayList<android.view.View>,%20java.lang.CharSequence,%20int%29)([ArrayList](/reference/java/util/ArrayList)<[View](/reference/android/view/View)> outViews, [CharSequence](/reference/java/lang/CharSequence) searched, int flags)

Finds the Views that contain given text.

boolean

[fitSystemWindows](/reference/android/view/View#fitSystemWindows%28android.graphics.Rect%29)([Rect](/reference/android/graphics/Rect) insets)

This method was deprecated in API level 20. As of API 20 use [dispatchApplyWindowInsets(WindowInsets)](/reference/android/view/View#dispatchApplyWindowInsets%28android.view.WindowInsets%29) to apply insets to views. Views should override [onApplyWindowInsets(WindowInsets)](/reference/android/view/View#onApplyWindowInsets%28android.view.WindowInsets%29) or use[setOnApplyWindowInsetsListener(android.view.View.OnApplyWindowInsetsListener)](/reference/android/view/View#setOnApplyWindowInsetsListener%28android.view.View.OnApplyWindowInsetsListener%29) to implement handling their own insets.

[View](/reference/android/view/View)

[focusSearch](/reference/android/view/View#focusSearch%28int%29)(int direction)

Find the nearest view in the specified direction that can take focus.

void

[forceHasOverlappingRendering](/reference/android/view/View#forceHasOverlappingRendering%28boolean%29)(boolean hasOverlappingRendering)

Sets the behavior for overlapping rendering for this view (see [hasOverlappingRendering()](/reference/android/view/View#hasOverlappingRendering%28%29) for more details on this behavior).

void

[forceLayout](/reference/android/view/View#forceLayout%28%29)()

Forces this view to be laid out during the next layout pass.

boolean

[gatherTransparentRegion](/reference/android/view/View#gatherTransparentRegion%28android.graphics.Region%29)([Region](/reference/android/graphics/Region) region)

This is used by the ViewRoot to perform an optimization when the view hierarchy contains one or several SurfaceView.

void

[generateDisplayHash](/reference/android/view/View#generateDisplayHash%28java.lang.String,%20android.graphics.Rect,%20java.util.concurrent.Executor,%20android.view.displayhash.DisplayHashResultCallback%29)([String](/reference/java/lang/String) hashAlgorithm, [Rect](/reference/android/graphics/Rect) bounds, [Executor](/reference/java/util/concurrent/Executor) executor, [DisplayHashResultCallback](/reference/android/view/displayhash/DisplayHashResultCallback) callback)

Called to generate a [DisplayHash](/reference/android/view/displayhash/DisplayHash) for this view.

static int

[generateViewId](/reference/android/view/View#generateViewId%28%29)()

Generate a value suitable for use in [setId(int)](/reference/android/view/View#setId%28int%29).

[CharSequence](/reference/java/lang/CharSequence)

[getAccessibilityClassName](/reference/android/view/View#getAccessibilityClassName%28%29)()

Return the class name of this object to be used for accessibility purposes.

[View.AccessibilityDelegate](/reference/android/view/View.AccessibilityDelegate)

[getAccessibilityDelegate](/reference/android/view/View#getAccessibilityDelegate%28%29)()

Returns the delegate for implementing accessibility support via composition.

int

[getAccessibilityLiveRegion](/reference/android/view/View#getAccessibilityLiveRegion%28%29)()

Gets the live region mode for this View.

[AccessibilityNodeProvider](/reference/android/view/accessibility/AccessibilityNodeProvider)

[getAccessibilityNodeProvider](/reference/android/view/View#getAccessibilityNodeProvider%28%29)()

Gets the provider for managing a virtual view hierarchy rooted at this View and reported to [AccessibilityService](/reference/android/accessibilityservice/AccessibilityService)s that explore the window content.

[CharSequence](/reference/java/lang/CharSequence)

[getAccessibilityPaneTitle](/reference/android/view/View#getAccessibilityPaneTitle%28%29)()

Get the title of the pane for purposes of accessibility.

int

[getAccessibilityTraversalAfter](/reference/android/view/View#getAccessibilityTraversalAfter%28%29)()

Gets the id of a view after which this one is visited in accessibility traversal.

int

[getAccessibilityTraversalBefore](/reference/android/view/View#getAccessibilityTraversalBefore%28%29)()

Gets the id of a view before which this one is visited in accessibility traversal.

[String](/reference/java/lang/String)

[getAllowedHandwritingDelegatePackageName](/reference/android/view/View#getAllowedHandwritingDelegatePackageName%28%29)()

Returns the allowed package for delegate editor views for which this view may act as a handwriting delegator, as set by [setAllowedHandwritingDelegatePackage(String)](/reference/android/view/View#setAllowedHandwritingDelegatePackage%28java.lang.String%29).

[String](/reference/java/lang/String)

[getAllowedHandwritingDelegatorPackageName](/reference/android/view/View#getAllowedHandwritingDelegatorPackageName%28%29)()

Returns the allowed package for views which may act as a handwriting delegator for this delegate editor view, as set by [setAllowedHandwritingDelegatorPackage(String)](/reference/android/view/View#setAllowedHandwritingDelegatorPackage%28java.lang.String%29).

float

[getAlpha](/reference/android/view/View#getAlpha%28%29)()

The opacity of the view.

[Animation](/reference/android/view/animation/Animation)

[getAnimation](/reference/android/view/View#getAnimation%28%29)()

Get the animation currently associated with this view.

[Matrix](/reference/android/graphics/Matrix)

[getAnimationMatrix](/reference/android/view/View#getAnimationMatrix%28%29)()

Return the current transformation matrix of the view.

[IBinder](/reference/android/os/IBinder)

[getApplicationWindowToken](/reference/android/view/View#getApplicationWindowToken%28%29)()

Retrieve a unique token identifying the top-level "real" window of the window that this view is attached to.

int[]

[getAttributeResolutionStack](/reference/android/view/View#getAttributeResolutionStack%28int%29)(int attribute)

Returns the ordered list of resource ID that are considered when resolving attribute values for this [View](/reference/android/view/View).

[Map](/reference/java/util/Map)<[Integer](/reference/java/lang/Integer), [Integer](/reference/java/lang/Integer)>

[getAttributeSourceResourceMap](/reference/android/view/View#getAttributeSourceResourceMap%28%29)()

Returns the mapping of attribute resource ID to source resource ID where the attribute value was set.

[String[]](/reference/java/lang/String)

[getAutofillHints](/reference/android/view/View#getAutofillHints%28%29)()

Gets the hints that help an [AutofillService](/reference/android/service/autofill/AutofillService) determine how to autofill the view with the user's data.

final[AutofillId](/reference/android/view/autofill/AutofillId)

[getAutofillId](/reference/android/view/View#getAutofillId%28%29)()

Gets the unique, logical identifier of this view in the activity, for autofill purposes.

int

[getAutofillType](/reference/android/view/View#getAutofillType%28%29)()

Describes the autofill type of this view, so an[AutofillService](/reference/android/service/autofill/AutofillService) can create the proper [AutofillValue](/reference/android/view/autofill/AutofillValue) when autofilling the view.

[AutofillValue](/reference/android/view/autofill/AutofillValue)

[getAutofillValue](/reference/android/view/View#getAutofillValue%28%29)()

Gets the [View](/reference/android/view/View)'s current autofill value.

[Drawable](/reference/android/graphics/drawable/Drawable)

[getBackground](/reference/android/view/View#getBackground%28%29)()

Gets the background drawable

[BlendMode](/reference/android/graphics/BlendMode)

[getBackgroundTintBlendMode](/reference/android/view/View#getBackgroundTintBlendMode%28%29)()

Return the blending mode used to apply the tint to the background drawable, if specified.

[ColorStateList](/reference/android/content/res/ColorStateList)

[getBackgroundTintList](/reference/android/view/View#getBackgroundTintList%28%29)()

Return the tint applied to the background drawable, if specified.

[PorterDuff.Mode](/reference/android/graphics/PorterDuff.Mode)

[getBackgroundTintMode](/reference/android/view/View#getBackgroundTintMode%28%29)()

Return the blending mode used to apply the tint to the background drawable, if specified.

int

[getBaseline](/reference/android/view/View#getBaseline%28%29)()

Return the offset of the widget's text baseline from the widget's top boundary.

final int

[getBottom](/reference/android/view/View#getBottom%28%29)()

Bottom position of this view relative to its parent.

float

[getBottomFadingEdgeStrength](/reference/android/view/View#getBottomFadingEdgeStrength%28%29)()

Returns the strength, or intensity, of the bottom faded edge.

int

[getBottomPaddingOffset](/reference/android/view/View#getBottomPaddingOffset%28%29)()

Amount by which to extend the bottom fading region.

float

[getCameraDistance](/reference/android/view/View#getCameraDistance%28%29)()

Gets the distance along the Z axis from the camera to this view.

boolean

[getClipBounds](/reference/android/view/View#getClipBounds%28android.graphics.Rect%29)([Rect](/reference/android/graphics/Rect) outRect)

Populates an output rectangle with the clip bounds of the view, returning true if successful or false if the view's clip bounds are null.

[Rect](/reference/android/graphics/Rect)

[getClipBounds](/reference/android/view/View#getClipBounds%28%29)()

Returns a copy of the current [clipBounds](/reference/android/view/View#setClipBounds%28android.graphics.Rect%29).

final boolean

[getClipToOutline](/reference/android/view/View#getClipToOutline%28%29)()

Returns whether the Outline should be used to clip the contents of the View.

final[ContentCaptureSession](/reference/android/view/contentcapture/ContentCaptureSession)

[getContentCaptureSession](/reference/android/view/View#getContentCaptureSession%28%29)()

Gets the session used to notify content capture events.

[CharSequence](/reference/java/lang/CharSequence)

[getContentDescription](/reference/android/view/View#getContentDescription%28%29)()

Returns the [View](/reference/android/view/View)'s content description.

final int

[getContentSensitivity](/reference/android/view/View#getContentSensitivity%28%29)()

Gets content sensitivity mode to determine whether this view displays sensitive content.

final[Context](/reference/android/content/Context)

[getContext](/reference/android/view/View#getContext%28%29)()

Returns the context the view is running in, through which it can access the current theme, resources, etc.

[ContextMenu.ContextMenuInfo](/reference/android/view/ContextMenu.ContextMenuInfo)

[getContextMenuInfo](/reference/android/view/View#getContextMenuInfo%28%29)()

Views should implement this if they have extra information to associate with the context menu.

final boolean

[getDefaultFocusHighlightEnabled](/reference/android/view/View#getDefaultFocusHighlightEnabled%28%29)()

Returns whether this View should use a default focus highlight when it gets focused but doesn't have [R.attr.state_focused](/reference/android/R.attr#state%5Ffocused) defined in its background.

static int

[getDefaultSize](/reference/android/view/View#getDefaultSize%28int,%20int%29)(int size, int measureSpec)

Utility to return a default size.

[Display](/reference/android/view/Display)

[getDisplay](/reference/android/view/View#getDisplay%28%29)()

Gets the logical display to which the view's window has been attached.

final int[]

[getDrawableState](/reference/android/view/View#getDrawableState%28%29)()

Return an array of resource IDs of the drawable states representing the current state of the view.

[Bitmap](/reference/android/graphics/Bitmap)

[getDrawingCache](/reference/android/view/View#getDrawingCache%28%29)()

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, [setLayerType(int,Paint)](/reference/android/view/View#setLayerType%28int,%20android.graphics.Paint%29) 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](/reference/android/graphics/Canvas) from either a [Bitmap](/reference/android/graphics/Bitmap) or[Picture](/reference/android/graphics/Picture) and call [draw(Canvas)](/reference/android/view/View#draw%28android.graphics.Canvas%29) on the View. However these software-rendered usages are discouraged and have compatibility issues with hardware-only rendering features such as [Config.HARDWARE](/reference/android/graphics/Bitmap.Config#HARDWARE) bitmaps, real-time shadows, and outline clipping. For screenshots of the UI for feedback reports or unit testing the [PixelCopy](/reference/android/view/PixelCopy) API is recommended.

[Bitmap](/reference/android/graphics/Bitmap)

[getDrawingCache](/reference/android/view/View#getDrawingCache%28boolean%29)(boolean autoScale)

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, [setLayerType(int,Paint)](/reference/android/view/View#setLayerType%28int,%20android.graphics.Paint%29) 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](/reference/android/graphics/Canvas) from either a [Bitmap](/reference/android/graphics/Bitmap) or[Picture](/reference/android/graphics/Picture) and call [draw(Canvas)](/reference/android/view/View#draw%28android.graphics.Canvas%29) on the View. However these software-rendered usages are discouraged and have compatibility issues with hardware-only rendering features such as [Config.HARDWARE](/reference/android/graphics/Bitmap.Config#HARDWARE) bitmaps, real-time shadows, and outline clipping. For screenshots of the UI for feedback reports or unit testing the [PixelCopy](/reference/android/view/PixelCopy) API is recommended.

int

[getDrawingCacheBackgroundColor](/reference/android/view/View#getDrawingCacheBackgroundColor%28%29)()

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, [setLayerType(int,Paint)](/reference/android/view/View#setLayerType%28int,%20android.graphics.Paint%29) 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](/reference/android/graphics/Canvas) from either a [Bitmap](/reference/android/graphics/Bitmap) or[Picture](/reference/android/graphics/Picture) and call [draw(Canvas)](/reference/android/view/View#draw%28android.graphics.Canvas%29) on the View. However these software-rendered usages are discouraged and have compatibility issues with hardware-only rendering features such as [Config.HARDWARE](/reference/android/graphics/Bitmap.Config#HARDWARE) bitmaps, real-time shadows, and outline clipping. For screenshots of the UI for feedback reports or unit testing the [PixelCopy](/reference/android/view/PixelCopy) API is recommended.

int

[getDrawingCacheQuality](/reference/android/view/View#getDrawingCacheQuality%28%29)()

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, [setLayerType(int,Paint)](/reference/android/view/View#setLayerType%28int,%20android.graphics.Paint%29) 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](/reference/android/graphics/Canvas) from either a [Bitmap](/reference/android/graphics/Bitmap) or[Picture](/reference/android/graphics/Picture) and call [draw(Canvas)](/reference/android/view/View#draw%28android.graphics.Canvas%29) on the View. However these software-rendered usages are discouraged and have compatibility issues with hardware-only rendering features such as [Config.HARDWARE](/reference/android/graphics/Bitmap.Config#HARDWARE) bitmaps, real-time shadows, and outline clipping. For screenshots of the UI for feedback reports or unit testing the [PixelCopy](/reference/android/view/PixelCopy) API is recommended.

void

[getDrawingRect](/reference/android/view/View#getDrawingRect%28android.graphics.Rect%29)([Rect](/reference/android/graphics/Rect) outRect)

Return the visible drawing bounds of your view.

long

[getDrawingTime](/reference/android/view/View#getDrawingTime%28%29)()

Return the time at which the drawing of the view hierarchy started.

float

[getElevation](/reference/android/view/View#getElevation%28%29)()

The base elevation of this view relative to its parent, in pixels.

int

[getExplicitStyle](/reference/android/view/View#getExplicitStyle%28%29)()

Returns the resource ID for the style specified using style="..." in the[AttributeSet](/reference/android/util/AttributeSet)'s backing XML element or [Resources.ID_NULL](/reference/android/content/res/Resources#ID%5FNULL) otherwise if not specified or otherwise not applicable.

boolean

[getFilterTouchesWhenObscured](/reference/android/view/View#getFilterTouchesWhenObscured%28%29)()

Gets whether the framework should discard touches when the view's window is obscured by another visible window at the touched location.

boolean

[getFitsSystemWindows](/reference/android/view/View#getFitsSystemWindows%28%29)()

Check for state of [setFitsSystemWindows(boolean)](/reference/android/view/View#setFitsSystemWindows%28boolean%29).

int

[getFocusable](/reference/android/view/View#getFocusable%28%29)()

Returns the focusable setting for this view.

[ArrayList](/reference/java/util/ArrayList)<[View](/reference/android/view/View)>

[getFocusables](/reference/android/view/View#getFocusables%28int%29)(int direction)

Find and return all focusable views that are descendants of this view, possibly including this view if it is focusable itself.

void

[getFocusedRect](/reference/android/view/View#getFocusedRect%28android.graphics.Rect%29)([Rect](/reference/android/graphics/Rect) r)

When a view has focus and the user navigates away from it, the next view is searched for starting from the rectangle filled in by this method.

[Drawable](/reference/android/graphics/drawable/Drawable)

[getForeground](/reference/android/view/View#getForeground%28%29)()

Returns the drawable used as the foreground of this View.

int

[getForegroundGravity](/reference/android/view/View#getForegroundGravity%28%29)()

Describes how the foreground is positioned.

[BlendMode](/reference/android/graphics/BlendMode)

[getForegroundTintBlendMode](/reference/android/view/View#getForegroundTintBlendMode%28%29)()

Return the blending mode used to apply the tint to the foreground drawable, if specified.

[ColorStateList](/reference/android/content/res/ColorStateList)

[getForegroundTintList](/reference/android/view/View#getForegroundTintList%28%29)()

Return the tint applied to the foreground drawable, if specified.

[PorterDuff.Mode](/reference/android/graphics/PorterDuff.Mode)

[getForegroundTintMode](/reference/android/view/View#getForegroundTintMode%28%29)()

Return the blending mode used to apply the tint to the foreground drawable, if specified.

float

[getFrameContentVelocity](/reference/android/view/View#getFrameContentVelocity%28%29)()

Get the current velocity of the View.

final boolean

[getGlobalVisibleRect](/reference/android/view/View#getGlobalVisibleRect%28android.graphics.Rect%29)([Rect](/reference/android/graphics/Rect) r)

Sets r to the coordinates of the non-clipped area of this view in the coordinate space of the view's root view.

boolean

[getGlobalVisibleRect](/reference/android/view/View#getGlobalVisibleRect%28android.graphics.Rect,%20android.graphics.Point%29)([Rect](/reference/android/graphics/Rect) r, [Point](/reference/android/graphics/Point) globalOffset)

Sets r to the coordinates of the non-clipped area of this view in the coordinate space of the view's root view.

[Handler](/reference/android/os/Handler)

[getHandler](/reference/android/view/View#getHandler%28%29)()

float

[getHandwritingBoundsOffsetBottom](/reference/android/view/View#getHandwritingBoundsOffsetBottom%28%29)()

Return the amount of offset applied to the bottom edge of this view's handwriting bounds, in the unit of pixel.

float

[getHandwritingBoundsOffsetLeft](/reference/android/view/View#getHandwritingBoundsOffsetLeft%28%29)()

Return the amount of offset applied to the left edge of this view's handwriting bounds, in the unit of pixel.

float

[getHandwritingBoundsOffsetRight](/reference/android/view/View#getHandwritingBoundsOffsetRight%28%29)()

Return the amount of offset applied to the right edge of this view's handwriting bounds, in the unit of pixel.

float

[getHandwritingBoundsOffsetTop](/reference/android/view/View#getHandwritingBoundsOffsetTop%28%29)()

Return the amount of offset applied to the top edge of this view's handwriting bounds, in the unit of pixel.

int

[getHandwritingDelegateFlags](/reference/android/view/View#getHandwritingDelegateFlags%28%29)()

Returns flags configuring the handwriting delegation behavior for this delegate editor view, as set by [setHandwritingDelegateFlags(int)](/reference/android/view/View#setHandwritingDelegateFlags%28int%29).

[Runnable](/reference/java/lang/Runnable)

[getHandwritingDelegatorCallback](/reference/android/view/View#getHandwritingDelegatorCallback%28%29)()

Returns the callback set by [setHandwritingDelegatorCallback(Runnable)](/reference/android/view/View#setHandwritingDelegatorCallback%28java.lang.Runnable%29) which should be called when a stylus [MotionEvent](/reference/android/view/MotionEvent) occurs within this view's bounds.

final boolean

[getHasOverlappingRendering](/reference/android/view/View#getHasOverlappingRendering%28%29)()

Returns the value for overlapping rendering that is used internally.

final int

[getHeight](/reference/android/view/View#getHeight%28%29)()

Return the height of your view.

void

[getHitRect](/reference/android/view/View#getHitRect%28android.graphics.Rect%29)([Rect](/reference/android/graphics/Rect) outRect)

Hit rectangle in parent's coordinates

int

[getHorizontalFadingEdgeLength](/reference/android/view/View#getHorizontalFadingEdgeLength%28%29)()

Returns the size of the horizontal faded edges used to indicate that more content in this view is visible.

int

[getHorizontalScrollbarHeight](/reference/android/view/View#getHorizontalScrollbarHeight%28%29)()

Returns the height of the horizontal scrollbar.

[Drawable](/reference/android/graphics/drawable/Drawable)

[getHorizontalScrollbarThumbDrawable](/reference/android/view/View#getHorizontalScrollbarThumbDrawable%28%29)()

Returns the currently configured Drawable for the thumb of the horizontal scroll bar if it exists, null otherwise.

[Drawable](/reference/android/graphics/drawable/Drawable)

[getHorizontalScrollbarTrackDrawable](/reference/android/view/View#getHorizontalScrollbarTrackDrawable%28%29)()

Returns the currently configured Drawable for the track of the horizontal scroll bar if it exists, null otherwise.

int

[getId](/reference/android/view/View#getId%28%29)()

Returns this view's identifier.

int

[getImportantForAccessibility](/reference/android/view/View#getImportantForAccessibility%28%29)()

Gets the mode for determining whether this View is important for accessibility.

int

[getImportantForAutofill](/reference/android/view/View#getImportantForAutofill%28%29)()

Gets the mode for determining whether this view is important for autofill.

int

[getImportantForContentCapture](/reference/android/view/View#getImportantForContentCapture%28%29)()

Gets the mode for determining whether this view is important for content capture.

boolean

[getKeepScreenOn](/reference/android/view/View#getKeepScreenOn%28%29)()

Returns whether the screen should remain on, corresponding to the current value of [KEEP_SCREEN_ON](/reference/android/view/View#KEEP%5FSCREEN%5FON).

[KeyEvent.DispatcherState](/reference/android/view/KeyEvent.DispatcherState)

[getKeyDispatcherState](/reference/android/view/View#getKeyDispatcherState%28%29)()

Return the global [KeyEvent.DispatcherState](/reference/android/view/KeyEvent.DispatcherState) for this view's window.

int

[getLabelFor](/reference/android/view/View#getLabelFor%28%29)()

Gets the id of a view for which this view serves as a label for accessibility purposes.

int

[getLayerType](/reference/android/view/View#getLayerType%28%29)()

Indicates what type of layer is currently associated with this view.

int

[getLayoutDirection](/reference/android/view/View#getLayoutDirection%28%29)()

Returns the resolved layout direction for this view.

[ViewGroup.LayoutParams](/reference/android/view/ViewGroup.LayoutParams)

[getLayoutParams](/reference/android/view/View#getLayoutParams%28%29)()

Get the LayoutParams associated with this view.

final int

[getLeft](/reference/android/view/View#getLeft%28%29)()

Left position of this view relative to its parent.

float

[getLeftFadingEdgeStrength](/reference/android/view/View#getLeftFadingEdgeStrength%28%29)()

Returns the strength, or intensity, of the left faded edge.

int

[getLeftPaddingOffset](/reference/android/view/View#getLeftPaddingOffset%28%29)()

Amount by which to extend the left fading region.

final boolean

[getLocalVisibleRect](/reference/android/view/View#getLocalVisibleRect%28android.graphics.Rect%29)([Rect](/reference/android/graphics/Rect) r)

Sets r to the coordinates of the non-clipped area of this view relative to the top left corner of the view.

void

[getLocationInSurface](/reference/android/view/View#getLocationInSurface%28int[]%29)(int[] location)

Gets the coordinates of this view in the coordinate space of the[Surface](/reference/android/view/Surface) that contains the view.

void

[getLocationInWindow](/reference/android/view/View#getLocationInWindow%28int[]%29)(int[] outLocation)

Gets the coordinates of this view in the coordinate space of the window that contains the view, irrespective of system decorations.

void

[getLocationOnScreen](/reference/android/view/View#getLocationOnScreen%28int[]%29)(int[] outLocation)

Gets the coordinates of this view in the coordinate space of the device screen, irrespective of system decorations and whether the system is in multi-window mode.

[Matrix](/reference/android/graphics/Matrix)

[getMatrix](/reference/android/view/View#getMatrix%28%29)()

The transform matrix of this view, which is calculated based on the current rotation, scale, and pivot properties.

final int

[getMeasuredHeight](/reference/android/view/View#getMeasuredHeight%28%29)()

Like [getMeasuredHeightAndState()](/reference/android/view/View#getMeasuredHeightAndState%28%29), but only returns the raw height component (that is the result is masked by[MEASURED_SIZE_MASK](/reference/android/view/View#MEASURED%5FSIZE%5FMASK)).

final int

[getMeasuredHeightAndState](/reference/android/view/View#getMeasuredHeightAndState%28%29)()

Return the full height measurement information for this view as computed by the most recent call to [measure(int, int)](/reference/android/view/View#measure%28int,%20int%29).

final int

[getMeasuredState](/reference/android/view/View#getMeasuredState%28%29)()

Return only the state bits of [getMeasuredWidthAndState()](/reference/android/view/View#getMeasuredWidthAndState%28%29) and [getMeasuredHeightAndState()](/reference/android/view/View#getMeasuredHeightAndState%28%29), combined into one integer.

final int

[getMeasuredWidth](/reference/android/view/View#getMeasuredWidth%28%29)()

Like [getMeasuredWidthAndState()](/reference/android/view/View#getMeasuredWidthAndState%28%29), but only returns the raw width component (that is the result is masked by[MEASURED_SIZE_MASK](/reference/android/view/View#MEASURED%5FSIZE%5FMASK)).

final int

[getMeasuredWidthAndState](/reference/android/view/View#getMeasuredWidthAndState%28%29)()

Return the full width measurement information for this view as computed by the most recent call to [measure(int, int)](/reference/android/view/View#measure%28int,%20int%29).

int

[getMinimumHeight](/reference/android/view/View#getMinimumHeight%28%29)()

Returns the minimum height of the view.

int

[getMinimumWidth](/reference/android/view/View#getMinimumWidth%28%29)()

Returns the minimum width of the view.

int

[getNextClusterForwardId](/reference/android/view/View#getNextClusterForwardId%28%29)()

Gets the id of the root of the next keyboard navigation cluster.

int

[getNextFocusDownId](/reference/android/view/View#getNextFocusDownId%28%29)()

Gets the id of the view to use when the next focus is [FOCUS_DOWN](/reference/android/view/View#FOCUS%5FDOWN).

int

[getNextFocusForwardId](/reference/android/view/View#getNextFocusForwardId%28%29)()

Gets the id of the view to use when the next focus is [FOCUS_FORWARD](/reference/android/view/View#FOCUS%5FFORWARD).

int

[getNextFocusLeftId](/reference/android/view/View#getNextFocusLeftId%28%29)()

Gets the id of the view to use when the next focus is [FOCUS_LEFT](/reference/android/view/View#FOCUS%5FLEFT).

int

[getNextFocusRightId](/reference/android/view/View#getNextFocusRightId%28%29)()

Gets the id of the view to use when the next focus is [FOCUS_RIGHT](/reference/android/view/View#FOCUS%5FRIGHT).

int

[getNextFocusUpId](/reference/android/view/View#getNextFocusUpId%28%29)()

Gets the id of the view to use when the next focus is [FOCUS_UP](/reference/android/view/View#FOCUS%5FUP).

[View.OnFocusChangeListener](/reference/android/view/View.OnFocusChangeListener)

[getOnFocusChangeListener](/reference/android/view/View#getOnFocusChangeListener%28%29)()

Returns the focus-change callback registered for this view.

int

[getOutlineAmbientShadowColor](/reference/android/view/View#getOutlineAmbientShadowColor%28%29)()

[ViewOutlineProvider](/reference/android/view/ViewOutlineProvider)

[getOutlineProvider](/reference/android/view/View#getOutlineProvider%28%29)()

Returns the current [ViewOutlineProvider](/reference/android/view/ViewOutlineProvider) of the view, which generates the Outline that defines the shape of the shadow it casts, and enables outline clipping.

int

[getOutlineSpotShadowColor](/reference/android/view/View#getOutlineSpotShadowColor%28%29)()

int

[getOverScrollMode](/reference/android/view/View#getOverScrollMode%28%29)()

Returns the over-scroll mode for this view.

[ViewOverlay](/reference/android/view/ViewOverlay)

[getOverlay](/reference/android/view/View#getOverlay%28%29)()

Returns the overlay for this view, creating it if it does not yet exist.

int

[getPaddingBottom](/reference/android/view/View#getPaddingBottom%28%29)()

Returns the bottom padding of this view.

int

[getPaddingEnd](/reference/android/view/View#getPaddingEnd%28%29)()

Returns the end padding of this view depending on its resolved layout direction.

int

[getPaddingLeft](/reference/android/view/View#getPaddingLeft%28%29)()

Returns the left padding of this view.

int

[getPaddingRight](/reference/android/view/View#getPaddingRight%28%29)()

Returns the right padding of this view.

int

[getPaddingStart](/reference/android/view/View#getPaddingStart%28%29)()

Returns the start padding of this view depending on its resolved layout direction.

int

[getPaddingTop](/reference/android/view/View#getPaddingTop%28%29)()

Returns the top padding of this view.

final[ViewParent](/reference/android/view/ViewParent)

[getParent](/reference/android/view/View#getParent%28%29)()

Gets the parent of this view.

[ViewParent](/reference/android/view/ViewParent)

[getParentForAccessibility](/reference/android/view/View#getParentForAccessibility%28%29)()

Gets the parent for accessibility purposes.

final[OutcomeReceiver](/reference/android/os/OutcomeReceiver)<[GetCredentialResponse](/reference/android/credentials/GetCredentialResponse), [GetCredentialException](/reference/android/credentials/GetCredentialException)>

[getPendingCredentialCallback](/reference/android/view/View#getPendingCredentialCallback%28%29)()

Returns the callback that has previously been set up on this view through the [setPendingCredentialRequest(GetCredentialRequest, OutcomeReceiver)](/reference/android/view/View#setPendingCredentialRequest%28android.credentials.GetCredentialRequest,%20android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException>%29) API.

final[GetCredentialRequest](/reference/android/credentials/GetCredentialRequest)

[getPendingCredentialRequest](/reference/android/view/View#getPendingCredentialRequest%28%29)()

Returns the [GetCredentialRequest](/reference/android/credentials/GetCredentialRequest) associated with the view.

float

[getPivotX](/reference/android/view/View#getPivotX%28%29)()

The x location of the point around which the view is [rotated](/reference/android/view/View#setRotation%28float%29) and [scaled](/reference/android/view/View#setScaleX%28float%29).

float

[getPivotY](/reference/android/view/View#getPivotY%28%29)()

The y location of the point around which the view is [rotated](/reference/android/view/View#setRotation%28float%29) and [scaled](/reference/android/view/View#setScaleY%28float%29).

[PointerIcon](/reference/android/view/PointerIcon)

[getPointerIcon](/reference/android/view/View#getPointerIcon%28%29)()

Gets the mouse pointer icon for the current view.

final[List](/reference/java/util/List)<[Rect](/reference/android/graphics/Rect)>

[getPreferKeepClearRects](/reference/android/view/View#getPreferKeepClearRects%28%29)()

[String[]](/reference/java/lang/String)

[getReceiveContentMimeTypes](/reference/android/view/View#getReceiveContentMimeTypes%28%29)()

Returns the MIME types accepted by [performReceiveContent(ContentInfo)](/reference/android/view/View#performReceiveContent%28android.view.ContentInfo%29) for this view, as configured via [setOnReceiveContentListener(String, OnReceiveContentListener)](/reference/android/view/View#setOnReceiveContentListener%28java.lang.String[],%20android.view.OnReceiveContentListener%29).

float

[getRequestedFrameRate](/reference/android/view/View#getRequestedFrameRate%28%29)()

Get the current preferred frame rate of the View.

[Resources](/reference/android/content/res/Resources)

[getResources](/reference/android/view/View#getResources%28%29)()

Returns the resources associated with this view.

final boolean

[getRevealOnFocusHint](/reference/android/view/View#getRevealOnFocusHint%28%29)()

Returns this view's preference for reveal behavior when it gains focus.

final int

[getRight](/reference/android/view/View#getRight%28%29)()

Right position of this view relative to its parent.

float

[getRightFadingEdgeStrength](/reference/android/view/View#getRightFadingEdgeStrength%28%29)()

Returns the strength, or intensity, of the right faded edge.

int

[getRightPaddingOffset](/reference/android/view/View#getRightPaddingOffset%28%29)()

Amount by which to extend the right fading region.

[AttachedSurfaceControl](/reference/android/view/AttachedSurfaceControl)

[getRootSurfaceControl](/reference/android/view/View#getRootSurfaceControl%28%29)()

The AttachedSurfaceControl itself is not a View, it is just the interface to the windowing-system object that contains the entire view hierarchy.

[View](/reference/android/view/View)

[getRootView](/reference/android/view/View#getRootView%28%29)()

Finds the topmost view in the current view hierarchy.

[WindowInsets](/reference/android/view/WindowInsets)

[getRootWindowInsets](/reference/android/view/View#getRootWindowInsets%28%29)()

Provide original WindowInsets that are dispatched to the view hierarchy.

float

[getRotation](/reference/android/view/View#getRotation%28%29)()

The degrees that the view is rotated around the pivot point.

float

[getRotationX](/reference/android/view/View#getRotationX%28%29)()

The degrees that the view is rotated around the horizontal axis through the pivot point.

float

[getRotationY](/reference/android/view/View#getRotationY%28%29)()

The degrees that the view is rotated around the vertical axis through the pivot point.

float

[getScaleX](/reference/android/view/View#getScaleX%28%29)()

The amount that the view is scaled in x around the pivot point, as a proportion of the view's unscaled width.

float

[getScaleY](/reference/android/view/View#getScaleY%28%29)()

The amount that the view is scaled in y around the pivot point, as a proportion of the view's unscaled height.

int

[getScrollBarDefaultDelayBeforeFade](/reference/android/view/View#getScrollBarDefaultDelayBeforeFade%28%29)()

Returns the delay before scrollbars fade.

int

[getScrollBarFadeDuration](/reference/android/view/View#getScrollBarFadeDuration%28%29)()

Returns the scrollbar fade duration.

int

[getScrollBarSize](/reference/android/view/View#getScrollBarSize%28%29)()

Returns the scrollbar size.

int

[getScrollBarStyle](/reference/android/view/View#getScrollBarStyle%28%29)()

Returns the current scrollbar style.

int

[getScrollCaptureHint](/reference/android/view/View#getScrollCaptureHint%28%29)()

Returns the current scroll capture hint for this view.

int

[getScrollIndicators](/reference/android/view/View#getScrollIndicators%28%29)()

Returns a bitmask representing the enabled scroll indicators.

final int

[getScrollX](/reference/android/view/View#getScrollX%28%29)()

Return the scrolled left position of this view.

final int

[getScrollY](/reference/android/view/View#getScrollY%28%29)()

Return the scrolled top position of this view.

int

[getSolidColor](/reference/android/view/View#getSolidColor%28%29)()

Override this if your view is known to always be drawn on top of a solid color background, and needs to draw fading edges.

int

[getSourceLayoutResId](/reference/android/view/View#getSourceLayoutResId%28%29)()

A [View](/reference/android/view/View) can be inflated from an XML layout.

final[CharSequence](/reference/java/lang/CharSequence)

[getStateDescription](/reference/android/view/View#getStateDescription%28%29)()

Returns the [View](/reference/android/view/View)'s state description.

[StateListAnimator](/reference/android/animation/StateListAnimator)

[getStateListAnimator](/reference/android/view/View#getStateListAnimator%28%29)()

Returns the current StateListAnimator if exists.

int

[getSuggestedMinimumHeight](/reference/android/view/View#getSuggestedMinimumHeight%28%29)()

Returns the suggested minimum height that the view should use.

int

[getSuggestedMinimumWidth](/reference/android/view/View#getSuggestedMinimumWidth%28%29)()

Returns the suggested minimum width that the view should use.

[CharSequence](/reference/java/lang/CharSequence)

[getSupplementalDescription](/reference/android/view/View#getSupplementalDescription%28%29)()

Returns the [View](/reference/android/view/View)'s supplemental description.

[List](/reference/java/util/List)<[Rect](/reference/android/graphics/Rect)>

[getSystemGestureExclusionRects](/reference/android/view/View#getSystemGestureExclusionRects%28%29)()

Retrieve the list of areas within this view's post-layout coordinate space where the system should not intercept touch or other pointing device gestures.

int

[getSystemUiVisibility](/reference/android/view/View#getSystemUiVisibility%28%29)()

This method was deprecated in API level 30. SystemUiVisibility flags are deprecated. Use [WindowInsetsController](/reference/android/view/WindowInsetsController) instead.

[Object](/reference/java/lang/Object)

[getTag](/reference/android/view/View#getTag%28%29)()

Returns this view's tag.

[Object](/reference/java/lang/Object)

[getTag](/reference/android/view/View#getTag%28int%29)(int key)

Returns the tag associated with this view and the specified key.

int

[getTextAlignment](/reference/android/view/View#getTextAlignment%28%29)()

Return the resolved text alignment.

int

[getTextDirection](/reference/android/view/View#getTextDirection%28%29)()

Return the resolved text direction.

[CharSequence](/reference/java/lang/CharSequence)

[getTooltipText](/reference/android/view/View#getTooltipText%28%29)()

Returns the view's tooltip text.

final int

[getTop](/reference/android/view/View#getTop%28%29)()

Top position of this view relative to its parent.

float

[getTopFadingEdgeStrength](/reference/android/view/View#getTopFadingEdgeStrength%28%29)()

Returns the strength, or intensity, of the top faded edge.

int

[getTopPaddingOffset](/reference/android/view/View#getTopPaddingOffset%28%29)()

Amount by which to extend the top fading region.

[TouchDelegate](/reference/android/view/TouchDelegate)

[getTouchDelegate](/reference/android/view/View#getTouchDelegate%28%29)()

Gets the TouchDelegate for this View.

[ArrayList](/reference/java/util/ArrayList)<[View](/reference/android/view/View)>

[getTouchables](/reference/android/view/View#getTouchables%28%29)()

Find and return all touchable views that are descendants of this view, possibly including this view if it is touchable itself.

float

[getTransitionAlpha](/reference/android/view/View#getTransitionAlpha%28%29)()

This property is intended only for use by the Fade transition, which animates it to produce a visual translucency that does not side-effect (or get affected by) the real alpha property.

[String](/reference/java/lang/String)

[getTransitionName](/reference/android/view/View#getTransitionName%28%29)()

Returns the name of the View to be used to identify Views in Transitions.

float

[getTranslationX](/reference/android/view/View#getTranslationX%28%29)()

The horizontal location of this view relative to its [left](/reference/android/view/View#getLeft%28%29) position.

float

[getTranslationY](/reference/android/view/View#getTranslationY%28%29)()

The vertical location of this view relative to its [top](/reference/android/view/View#getTop%28%29) position.

float

[getTranslationZ](/reference/android/view/View#getTranslationZ%28%29)()

The depth location of this view relative to its [elevation](/reference/android/view/View#getElevation%28%29).

long

[getUniqueDrawingId](/reference/android/view/View#getUniqueDrawingId%28%29)()

Get the identifier used for this view by the drawing system.

int

[getVerticalFadingEdgeLength](/reference/android/view/View#getVerticalFadingEdgeLength%28%29)()

Returns the size of the vertical faded edges used to indicate that more content in this view is visible.

int

[getVerticalScrollbarPosition](/reference/android/view/View#getVerticalScrollbarPosition%28%29)()

[Drawable](/reference/android/graphics/drawable/Drawable)

[getVerticalScrollbarThumbDrawable](/reference/android/view/View#getVerticalScrollbarThumbDrawable%28%29)()

Returns the currently configured Drawable for the thumb of the vertical scroll bar if it exists, null otherwise.

[Drawable](/reference/android/graphics/drawable/Drawable)

[getVerticalScrollbarTrackDrawable](/reference/android/view/View#getVerticalScrollbarTrackDrawable%28%29)()

Returns the currently configured Drawable for the track of the vertical scroll bar if it exists, null otherwise.

int

[getVerticalScrollbarWidth](/reference/android/view/View#getVerticalScrollbarWidth%28%29)()

Returns the width of the vertical scrollbar.

[ViewTranslationResponse](/reference/android/view/translation/ViewTranslationResponse)

[getViewTranslationResponse](/reference/android/view/View#getViewTranslationResponse%28%29)()

Returns the [ViewTranslationResponse](/reference/android/view/translation/ViewTranslationResponse) associated with this view.

[ViewTreeObserver](/reference/android/view/ViewTreeObserver)

[getViewTreeObserver](/reference/android/view/View#getViewTreeObserver%28%29)()

Returns the ViewTreeObserver for this view's hierarchy.

int

[getVisibility](/reference/android/view/View#getVisibility%28%29)()

Returns the visibility status for this view.

final int

[getWidth](/reference/android/view/View#getWidth%28%29)()

Return the width of your view.

int

[getWindowAttachCount](/reference/android/view/View#getWindowAttachCount%28%29)()

[WindowId](/reference/android/view/WindowId)

[getWindowId](/reference/android/view/View#getWindowId%28%29)()

Retrieve the [WindowId](/reference/android/view/WindowId) for the window this view is currently attached to.

[WindowInsetsController](/reference/android/view/WindowInsetsController)

[getWindowInsetsController](/reference/android/view/View#getWindowInsetsController%28%29)()

Retrieves the single [WindowInsetsController](/reference/android/view/WindowInsetsController) of the window this view is attached to.

int

[getWindowSystemUiVisibility](/reference/android/view/View#getWindowSystemUiVisibility%28%29)()

This method was deprecated in API level 30. SystemUiVisibility flags are deprecated. Use [WindowInsetsController](/reference/android/view/WindowInsetsController) instead.

[IBinder](/reference/android/os/IBinder)

[getWindowToken](/reference/android/view/View#getWindowToken%28%29)()

Retrieve a unique token identifying the window this view is attached to.

int

[getWindowVisibility](/reference/android/view/View#getWindowVisibility%28%29)()

Returns the current visibility of the window this view is attached to (either [GONE](/reference/android/view/View#GONE), [INVISIBLE](/reference/android/view/View#INVISIBLE), or [VISIBLE](/reference/android/view/View#VISIBLE)).

void

[getWindowVisibleDisplayFrame](/reference/android/view/View#getWindowVisibleDisplayFrame%28android.graphics.Rect%29)([Rect](/reference/android/graphics/Rect) outRect)

Retrieve the overall visible display size in which the window this view is attached to has been positioned in.

float

[getX](/reference/android/view/View#getX%28%29)()

The visual x position of this view, in pixels.

float

[getY](/reference/android/view/View#getY%28%29)()

The visual y position of this view, in pixels.

float

[getZ](/reference/android/view/View#getZ%28%29)()

The visual z position of this view, in pixels.

boolean

[hasExplicitFocusable](/reference/android/view/View#hasExplicitFocusable%28%29)()

Returns true if this view is focusable or if it contains a reachable View for which [hasExplicitFocusable()](/reference/android/view/View#hasExplicitFocusable%28%29) returns true.

boolean

[hasFocus](/reference/android/view/View#hasFocus%28%29)()

Returns true if this view has focus itself, or is the ancestor of the view that has focus.

boolean

[hasFocusable](/reference/android/view/View#hasFocusable%28%29)()

Returns true if this view is focusable or if it contains a reachable View for which [hasFocusable()](/reference/android/view/View#hasFocusable%28%29) returns true.

boolean

[hasNestedScrollingParent](/reference/android/view/View#hasNestedScrollingParent%28%29)()

Returns true if this view has a nested scrolling parent.

boolean

[hasOnClickListeners](/reference/android/view/View#hasOnClickListeners%28%29)()

Return whether this view has an attached OnClickListener.

boolean

[hasOnLongClickListeners](/reference/android/view/View#hasOnLongClickListeners%28%29)()

Return whether this view has an attached OnLongClickListener.

boolean

[hasOverlappingRendering](/reference/android/view/View#hasOverlappingRendering%28%29)()

Returns whether this View has content which overlaps.

boolean

[hasPointerCapture](/reference/android/view/View#hasPointerCapture%28%29)()

Checks pointer capture status.

boolean

[hasTransientState](/reference/android/view/View#hasTransientState%28%29)()

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.

boolean

[hasWindowFocus](/reference/android/view/View#hasWindowFocus%28%29)()

Returns true if this view is in a window that currently has window focus.

static[View](/reference/android/view/View)

[inflate](/reference/android/view/View#inflate%28android.content.Context,%20int,%20android.view.ViewGroup%29)([Context](/reference/android/content/Context) context, int resource, [ViewGroup](/reference/android/view/ViewGroup) root)

Inflate a view from an XML resource.

void

[invalidate](/reference/android/view/View#invalidate%28%29)()

Invalidate the whole view.

void

[invalidate](/reference/android/view/View#invalidate%28android.graphics.Rect%29)([Rect](/reference/android/graphics/Rect) dirty)

This method was deprecated in API level 28. The switch to hardware accelerated rendering in API 14 reduced the importance of the dirty rectangle. In API 21 the given rectangle is ignored entirely in favor of an internally-calculated area instead. Because of this, clients are encouraged to just call [invalidate()](/reference/android/view/View#invalidate%28%29).

void

[invalidate](/reference/android/view/View#invalidate%28int,%20int,%20int,%20int%29)(int l, int t, int r, int b)

This method was deprecated in API level 28. The switch to hardware accelerated rendering in API 14 reduced the importance of the dirty rectangle. In API 21 the given rectangle is ignored entirely in favor of an internally-calculated area instead. Because of this, clients are encouraged to just call [invalidate()](/reference/android/view/View#invalidate%28%29).

void

[invalidateDrawable](/reference/android/view/View#invalidateDrawable%28android.graphics.drawable.Drawable%29)([Drawable](/reference/android/graphics/drawable/Drawable) drawable)

Invalidates the specified Drawable.

void

[invalidateOutline](/reference/android/view/View#invalidateOutline%28%29)()

Called to rebuild this View's Outline from its [outline provider](/reference/android/view/ViewOutlineProvider)

boolean

[isAccessibilityDataSensitive](/reference/android/view/View#isAccessibilityDataSensitive%28%29)()

Whether this view should restrict accessibility service access only to services that have the[AccessibilityServiceInfo.isAccessibilityTool()](/reference/android/accessibilityservice/AccessibilityServiceInfo#isAccessibilityTool%28%29) property set to true.

boolean

[isAccessibilityFocused](/reference/android/view/View#isAccessibilityFocused%28%29)()

Returns whether this View is accessibility focused.

boolean

[isAccessibilityHeading](/reference/android/view/View#isAccessibilityHeading%28%29)()

Gets whether this view is a heading for accessibility purposes.

boolean

[isActivated](/reference/android/view/View#isActivated%28%29)()

Indicates the activation state of this view.

boolean

[isAttachedToWindow](/reference/android/view/View#isAttachedToWindow%28%29)()

Returns true if this view is currently attached to a window.

boolean

[isAutoHandwritingEnabled](/reference/android/view/View#isAutoHandwritingEnabled%28%29)()

Return whether the View allows automatic handwriting initiation.

boolean

[isClickable](/reference/android/view/View#isClickable%28%29)()

Indicates whether this view reacts to click events or not.

final boolean

[isContentSensitive](/reference/android/view/View#isContentSensitive%28%29)()

Returns whether this view displays sensitive content, based on the value explicitly set by [setContentSensitivity(int)](/reference/android/view/View#setContentSensitivity%28int%29).

boolean

[isContextClickable](/reference/android/view/View#isContextClickable%28%29)()

Indicates whether this view reacts to context clicks or not.

boolean

[isCredential](/reference/android/view/View#isCredential%28%29)()

This method was deprecated in API level 37. The [isCredential()](/reference/android/view/View#isCredential%28%29) is no longer used by the system and is not recommended for use by apps. The purpose and usage expectations of this property were never clearly defined.

boolean

[isDirty](/reference/android/view/View#isDirty%28%29)()

True if this view has changed since the last time being drawn.

boolean

[isDrawingCacheEnabled](/reference/android/view/View#isDrawingCacheEnabled%28%29)()

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, [setLayerType(int,Paint)](/reference/android/view/View#setLayerType%28int,%20android.graphics.Paint%29) 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](/reference/android/graphics/Canvas) from either a [Bitmap](/reference/android/graphics/Bitmap) or[Picture](/reference/android/graphics/Picture) and call [draw(Canvas)](/reference/android/view/View#draw%28android.graphics.Canvas%29) on the View. However these software-rendered usages are discouraged and have compatibility issues with hardware-only rendering features such as [Config.HARDWARE](/reference/android/graphics/Bitmap.Config#HARDWARE) bitmaps, real-time shadows, and outline clipping. For screenshots of the UI for feedback reports or unit testing the [PixelCopy](/reference/android/view/PixelCopy) API is recommended.

boolean

[isDuplicateParentStateEnabled](/reference/android/view/View#isDuplicateParentStateEnabled%28%29)()

Indicates whether this duplicates its drawable state from its parent.

boolean

[isEnabled](/reference/android/view/View#isEnabled%28%29)()

Returns the enabled status for this view.

final boolean

[isFocusable](/reference/android/view/View#isFocusable%28%29)()

Returns whether this View is currently able to take focus.

final boolean

[isFocusableInTouchMode](/reference/android/view/View#isFocusableInTouchMode%28%29)()

When a view is focusable, it may not want to take focus when in touch mode.

boolean

[isFocused](/reference/android/view/View#isFocused%28%29)()

Returns true if this view has focus

final boolean

[isFocusedByDefault](/reference/android/view/View#isFocusedByDefault%28%29)()

Returns whether this View should receive focus when the focus is restored for the view hierarchy containing this view.

boolean

[isForceDarkAllowed](/reference/android/view/View#isForceDarkAllowed%28%29)()

See [setForceDarkAllowed(boolean)](/reference/android/view/View#setForceDarkAllowed%28boolean%29)

boolean

[isHandwritingDelegate](/reference/android/view/View#isHandwritingDelegate%28%29)()

Returns whether this view has been set as a handwriting delegate by [setIsHandwritingDelegate(boolean)](/reference/android/view/View#setIsHandwritingDelegate%28boolean%29).

boolean

[isHapticFeedbackEnabled](/reference/android/view/View#isHapticFeedbackEnabled%28%29)()

boolean

[isHardwareAccelerated](/reference/android/view/View#isHardwareAccelerated%28%29)()

Indicates whether this view is attached to a hardware accelerated window or not.

boolean

[isHorizontalFadingEdgeEnabled](/reference/android/view/View#isHorizontalFadingEdgeEnabled%28%29)()

Indicate whether the horizontal edges are faded when the view is scrolled horizontally.

boolean

[isHorizontalScrollBarEnabled](/reference/android/view/View#isHorizontalScrollBarEnabled%28%29)()

Indicate whether the horizontal scrollbar should be drawn or not.

boolean

[isHovered](/reference/android/view/View#isHovered%28%29)()

Returns true if the view is currently hovered.

boolean

[isImportantForAccessibility](/reference/android/view/View#isImportantForAccessibility%28%29)()

Computes whether this view should be exposed for accessibility.

final boolean

[isImportantForAutofill](/reference/android/view/View#isImportantForAutofill%28%29)()

Hints the Android System whether the [AssistStructure.ViewNode](/reference/android/app/assist/AssistStructure.ViewNode) associated with this view is considered important for autofill purposes.

final boolean

[isImportantForContentCapture](/reference/android/view/View#isImportantForContentCapture%28%29)()

Hints the Android System whether this view is considered important for content capture, based on the value explicitly set by [setImportantForContentCapture(int)](/reference/android/view/View#setImportantForContentCapture%28int%29) and heuristics when it's [IMPORTANT_FOR_CONTENT_CAPTURE_AUTO](/reference/android/view/View#IMPORTANT%5FFOR%5FCONTENT%5FCAPTURE%5FAUTO).

boolean

[isInEditMode](/reference/android/view/View#isInEditMode%28%29)()

Indicates whether this View is currently in edit mode.

boolean

[isInLayout](/reference/android/view/View#isInLayout%28%29)()

Returns whether the view hierarchy is currently undergoing a layout pass.

boolean

[isInTouchMode](/reference/android/view/View#isInTouchMode%28%29)()

Returns the touch mode state associated with this view.

final boolean

[isKeyboardNavigationCluster](/reference/android/view/View#isKeyboardNavigationCluster%28%29)()

Returns whether this View is a root of a keyboard navigation cluster.

boolean

[isLaidOut](/reference/android/view/View#isLaidOut%28%29)()

Returns true if this view has been through at least one layout since it was last attached to or detached from a window.

boolean

[isLayoutDirectionResolved](/reference/android/view/View#isLayoutDirectionResolved%28%29)()

boolean

[isLayoutRequested](/reference/android/view/View#isLayoutRequested%28%29)()

Indicates whether or not this view's layout will be requested during the next hierarchy layout pass.

boolean

[isLongClickable](/reference/android/view/View#isLongClickable%28%29)()

Indicates whether this view reacts to long click events or not.

boolean

[isNestedScrollingEnabled](/reference/android/view/View#isNestedScrollingEnabled%28%29)()

Returns true if nested scrolling is enabled for this view.

boolean

[isOpaque](/reference/android/view/View#isOpaque%28%29)()

Indicates whether this View is opaque.

boolean

[isPaddingOffsetRequired](/reference/android/view/View#isPaddingOffsetRequired%28%29)()

If the View draws content inside its padding and enables fading edges, it needs to support padding offsets.

boolean

[isPaddingRelative](/reference/android/view/View#isPaddingRelative%28%29)()

Return if the padding has been set through relative values[setPaddingRelative(int, int, int, int)](/reference/android/view/View#setPaddingRelative%28int,%20int,%20int,%20int%29) or through

boolean

[isPivotSet](/reference/android/view/View#isPivotSet%28%29)()

Returns whether or not a pivot has been set by a call to [setPivotX(float)](/reference/android/view/View#setPivotX%28float%29) or[setPivotY(float)](/reference/android/view/View#setPivotY%28float%29).

final boolean

[isPreferKeepClear](/reference/android/view/View#isPreferKeepClear%28%29)()

Retrieve the preference for this view to be kept clear.

boolean

[isPressed](/reference/android/view/View#isPressed%28%29)()

Indicates whether the view is currently in pressed state.

boolean

[isSaveEnabled](/reference/android/view/View#isSaveEnabled%28%29)()

Indicates whether this view will save its state (that is, whether its [onSaveInstanceState()](/reference/android/view/View#onSaveInstanceState%28%29) method will be called).

boolean

[isSaveFromParentEnabled](/reference/android/view/View#isSaveFromParentEnabled%28%29)()

Indicates whether the entire hierarchy under this view will save its state when a state saving traversal occurs from its parent.

boolean

[isScreenReaderFocusable](/reference/android/view/View#isScreenReaderFocusable%28%29)()

Returns whether the view should be treated as a focusable unit by screen reader accessibility tools.

boolean

[isScrollContainer](/reference/android/view/View#isScrollContainer%28%29)()

Indicates whether this view is one of the set of scrollable containers in its window.

boolean

[isScrollbarFadingEnabled](/reference/android/view/View#isScrollbarFadingEnabled%28%29)()

Returns true if scrollbars will fade when this view is not scrolling

boolean

[isSelected](/reference/android/view/View#isSelected%28%29)()

Indicates the selection state of this view.

final boolean

[isShowingLayoutBounds](/reference/android/view/View#isShowingLayoutBounds%28%29)()

Returns true when the View is attached and the system developer setting to show the layout bounds is enabled or false otherwise.

boolean

[isShown](/reference/android/view/View#isShown%28%29)()

Returns the visibility of this view and all of its ancestors

boolean

[isSoundEffectsEnabled](/reference/android/view/View#isSoundEffectsEnabled%28%29)()

final boolean

[isTemporarilyDetached](/reference/android/view/View#isTemporarilyDetached%28%29)()

Tells whether the [View](/reference/android/view/View) is in the state between [onStartTemporaryDetach()](/reference/android/view/View#onStartTemporaryDetach%28%29) and [onFinishTemporaryDetach()](/reference/android/view/View#onFinishTemporaryDetach%28%29).

boolean

[isTextAlignmentResolved](/reference/android/view/View#isTextAlignmentResolved%28%29)()

boolean

[isTextDirectionResolved](/reference/android/view/View#isTextDirectionResolved%28%29)()

boolean

[isVerticalFadingEdgeEnabled](/reference/android/view/View#isVerticalFadingEdgeEnabled%28%29)()

Indicate whether the vertical edges are faded when the view is scrolled horizontally.

boolean

[isVerticalScrollBarEnabled](/reference/android/view/View#isVerticalScrollBarEnabled%28%29)()

Indicate whether the vertical scrollbar should be drawn or not.

boolean

[isVisibleToUserForAutofill](/reference/android/view/View#isVisibleToUserForAutofill%28int%29)(int virtualId)

Computes whether this virtual autofill view is visible to the user.

void

[jumpDrawablesToCurrentState](/reference/android/view/View#jumpDrawablesToCurrentState%28%29)()

Call [Drawable.jumpToCurrentState()](/reference/android/graphics/drawable/Drawable#jumpToCurrentState%28%29) on all Drawable objects associated with this view.

[View](/reference/android/view/View)

[keyboardNavigationClusterSearch](/reference/android/view/View#keyboardNavigationClusterSearch%28android.view.View,%20int%29)([View](/reference/android/view/View) currentCluster, int direction)

Find the nearest keyboard navigation cluster in the specified direction.

void

[layout](/reference/android/view/View#layout%28int,%20int,%20int,%20int%29)(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.

final void

[measure](/reference/android/view/View#measure%28int,%20int%29)(int widthMeasureSpec, int heightMeasureSpec)

This is called to find out how big a view should be.

static int[]

[mergeDrawableStates](/reference/android/view/View#mergeDrawableStates%28int[],%20int[]%29)(int[] baseState, int[] additionalState)

Merge your own state values in additionalState into the base state values baseState that were returned by[onCreateDrawableState(int)](/reference/android/view/View#onCreateDrawableState%28int%29).

void

[offsetLeftAndRight](/reference/android/view/View#offsetLeftAndRight%28int%29)(int offset)

Offset this view's horizontal location by the specified amount of pixels.

void

[offsetTopAndBottom](/reference/android/view/View#offsetTopAndBottom%28int%29)(int offset)

Offset this view's vertical location by the specified number of pixels.

void

[onAnimationEnd](/reference/android/view/View#onAnimationEnd%28%29)()

Invoked by a parent ViewGroup to notify the end of the animation currently associated with this view.

void

[onAnimationStart](/reference/android/view/View#onAnimationStart%28%29)()

Invoked by a parent ViewGroup to notify the start of the animation currently associated with this view.

[WindowInsets](/reference/android/view/WindowInsets)

[onApplyWindowInsets](/reference/android/view/View#onApplyWindowInsets%28android.view.WindowInsets%29)([WindowInsets](/reference/android/view/WindowInsets) insets)

Called when the view should apply [WindowInsets](/reference/android/view/WindowInsets) according to its internal policy.

void

[onAttachedToWindow](/reference/android/view/View#onAttachedToWindow%28%29)()

This is called when the view is attached to a window.

void

[onCancelPendingInputEvents](/reference/android/view/View#onCancelPendingInputEvents%28%29)()

Called as the result of a call to [cancelPendingInputEvents()](/reference/android/view/View#cancelPendingInputEvents%28%29) on this view or a parent view.

boolean

[onCapturedPointerEvent](/reference/android/view/View#onCapturedPointerEvent%28android.view.MotionEvent%29)([MotionEvent](/reference/android/view/MotionEvent) event)

Implement this method to handle captured pointer events

boolean

[onCheckIsTextEditor](/reference/android/view/View#onCheckIsTextEditor%28%29)()

Check whether the called view is a text editor, in which case it would make sense to automatically display a soft input window for it.

void

[onConfigurationChanged](/reference/android/view/View#onConfigurationChanged%28android.content.res.Configuration%29)([Configuration](/reference/android/content/res/Configuration) newConfig)

Called when the current configuration of the resources being used by the application have changed.

void

[onCreateContextMenu](/reference/android/view/View#onCreateContextMenu%28android.view.ContextMenu%29)([ContextMenu](/reference/android/view/ContextMenu) menu)

Views should implement this if the view itself is going to add items to the context menu.

int[]

[onCreateDrawableState](/reference/android/view/View#onCreateDrawableState%28int%29)(int extraSpace)

Generate the new [Drawable](/reference/android/graphics/drawable/Drawable) state for this view.

[InputConnection](/reference/android/view/inputmethod/InputConnection)

[onCreateInputConnection](/reference/android/view/View#onCreateInputConnection%28android.view.inputmethod.EditorInfo%29)([EditorInfo](/reference/android/view/inputmethod/EditorInfo) outAttrs)

Create a new InputConnection for an InputMethod to interact with the view.

void

[onCreateViewTranslationRequest](/reference/android/view/View#onCreateViewTranslationRequest%28int[],%20java.util.function.Consumer<android.view.translation.ViewTranslationRequest>%29)(int[] supportedFormats, [Consumer](/reference/java/util/function/Consumer)<[ViewTranslationRequest](/reference/android/view/translation/ViewTranslationRequest)> requestsCollector)

Collects a [ViewTranslationRequest](/reference/android/view/translation/ViewTranslationRequest) which represents the content to be translated in the view.

void

[onCreateVirtualViewTranslationRequests](/reference/android/view/View#onCreateVirtualViewTranslationRequests%28long[],%20int[],%20java.util.function.Consumer<android.view.translation.ViewTranslationRequest>%29)(long[] virtualIds, int[] supportedFormats, [Consumer](/reference/java/util/function/Consumer)<[ViewTranslationRequest](/reference/android/view/translation/ViewTranslationRequest)> requestsCollector)

Collects [ViewTranslationRequest](/reference/android/view/translation/ViewTranslationRequest)s which represents the content to be translated for the virtual views in the host view.

void

[onDetachedFromWindow](/reference/android/view/View#onDetachedFromWindow%28%29)()

This is called when the view is detached from a window.

void

[onDisplayHint](/reference/android/view/View#onDisplayHint%28int%29)(int hint)

Gives this view a hint about whether is displayed or not.

boolean

[onDragEvent](/reference/android/view/View#onDragEvent%28android.view.DragEvent%29)([DragEvent](/reference/android/view/DragEvent) event)

Handles drag events sent by the system following a call to[startDragAndDrop()](/reference/android/view/View#startDragAndDrop%28android.content.ClipData,%20android.view.View.DragShadowBuilder,%20java.lang.Object,%20int%29).

void

[onDraw](/reference/android/view/View#onDraw%28android.graphics.Canvas%29)([Canvas](/reference/android/graphics/Canvas) canvas)

Implement this to do your drawing.

void

[onDrawForeground](/reference/android/view/View#onDrawForeground%28android.graphics.Canvas%29)([Canvas](/reference/android/graphics/Canvas) canvas)

Draw any foreground content for this view.

final void

[onDrawScrollBars](/reference/android/view/View#onDrawScrollBars%28android.graphics.Canvas%29)([Canvas](/reference/android/graphics/Canvas) canvas)

Request the drawing of the horizontal and the vertical scrollbar.

boolean

[onFilterTouchEventForSecurity](/reference/android/view/View#onFilterTouchEventForSecurity%28android.view.MotionEvent%29)([MotionEvent](/reference/android/view/MotionEvent) event)

Filter the touch event to apply security policies.

void

[onFinishInflate](/reference/android/view/View#onFinishInflate%28%29)()

Finalize inflating a view from XML.

void

[onFinishTemporaryDetach](/reference/android/view/View#onFinishTemporaryDetach%28%29)()

Called after [onStartTemporaryDetach()](/reference/android/view/View#onStartTemporaryDetach%28%29) when the container is done changing the view.

void

[onFocusChanged](/reference/android/view/View#onFocusChanged%28boolean,%20int,%20android.graphics.Rect%29)(boolean gainFocus, int direction, [Rect](/reference/android/graphics/Rect) previouslyFocusedRect)

Called by the view system when the focus state of this view changes.

boolean

[onGenericMotionEvent](/reference/android/view/View#onGenericMotionEvent%28android.view.MotionEvent%29)([MotionEvent](/reference/android/view/MotionEvent) event)

Implement this method to handle generic motion events.

void

[onHoverChanged](/reference/android/view/View#onHoverChanged%28boolean%29)(boolean hovered)

Implement this method to handle hover state changes.

boolean

[onHoverEvent](/reference/android/view/View#onHoverEvent%28android.view.MotionEvent%29)([MotionEvent](/reference/android/view/MotionEvent) event)

Implement this method to handle hover events.

void

[onInitializeAccessibilityEvent](/reference/android/view/View#onInitializeAccessibilityEvent%28android.view.accessibility.AccessibilityEvent%29)([AccessibilityEvent](/reference/android/view/accessibility/AccessibilityEvent) event)

Initializes an [AccessibilityEvent](/reference/android/view/accessibility/AccessibilityEvent) with information about this View which is the event source.

void

[onInitializeAccessibilityNodeInfo](/reference/android/view/View#onInitializeAccessibilityNodeInfo%28android.view.accessibility.AccessibilityNodeInfo%29)([AccessibilityNodeInfo](/reference/android/view/accessibility/AccessibilityNodeInfo) info)

Initializes an [AccessibilityNodeInfo](/reference/android/view/accessibility/AccessibilityNodeInfo) with information about this view.

boolean

[onKeyDown](/reference/android/view/View#onKeyDown%28int,%20android.view.KeyEvent%29)(int keyCode, [KeyEvent](/reference/android/view/KeyEvent) event)

Default implementation of [KeyEvent.Callback.onKeyDown()](/reference/android/view/KeyEvent.Callback#onKeyDown%28int,%20android.view.KeyEvent%29): perform press of the view when [KeyEvent.KEYCODE_DPAD_CENTER](/reference/android/view/KeyEvent#KEYCODE%5FDPAD%5FCENTER) or [KeyEvent.KEYCODE_ENTER](/reference/android/view/KeyEvent#KEYCODE%5FENTER) is released, if the view is enabled and clickable.

boolean

[onKeyLongPress](/reference/android/view/View#onKeyLongPress%28int,%20android.view.KeyEvent%29)(int keyCode, [KeyEvent](/reference/android/view/KeyEvent) event)

Default implementation of [KeyEvent.Callback.onKeyLongPress()](/reference/android/view/KeyEvent.Callback#onKeyLongPress%28int,%20android.view.KeyEvent%29): always returns false (doesn't handle the event).

boolean

[onKeyMultiple](/reference/android/view/View#onKeyMultiple%28int,%20int,%20android.view.KeyEvent%29)(int keyCode, int repeatCount, [KeyEvent](/reference/android/view/KeyEvent) event)

Default implementation of [KeyEvent.Callback.onKeyMultiple()](/reference/android/view/KeyEvent.Callback#onKeyMultiple%28int,%20int,%20android.view.KeyEvent%29): always returns false (doesn't handle the event).

boolean

[onKeyPreIme](/reference/android/view/View#onKeyPreIme%28int,%20android.view.KeyEvent%29)(int keyCode, [KeyEvent](/reference/android/view/KeyEvent) event)

Handle a key event before it is processed by any input method associated with the view hierarchy.

boolean

[onKeyShortcut](/reference/android/view/View#onKeyShortcut%28int,%20android.view.KeyEvent%29)(int keyCode, [KeyEvent](/reference/android/view/KeyEvent) event)

Called on the focused view when a key shortcut event is not handled.

boolean

[onKeyUp](/reference/android/view/View#onKeyUp%28int,%20android.view.KeyEvent%29)(int keyCode, [KeyEvent](/reference/android/view/KeyEvent) event)

Default implementation of [KeyEvent.Callback.onKeyUp()](/reference/android/view/KeyEvent.Callback#onKeyUp%28int,%20android.view.KeyEvent%29): perform clicking of the view when [KeyEvent.KEYCODE_DPAD_CENTER](/reference/android/view/KeyEvent#KEYCODE%5FDPAD%5FCENTER), [KeyEvent.KEYCODE_ENTER](/reference/android/view/KeyEvent#KEYCODE%5FENTER) or [KeyEvent.KEYCODE_SPACE](/reference/android/view/KeyEvent#KEYCODE%5FSPACE) is released.

void

[onLayout](/reference/android/view/View#onLayout%28boolean,%20int,%20int,%20int,%20int%29)(boolean changed, int left, int top, int right, int bottom)

Called from layout when this view should assign a size and position to each of its children.

void

[onMeasure](/reference/android/view/View#onMeasure%28int,%20int%29)(int widthMeasureSpec, int heightMeasureSpec)

Measure the view and its content to determine the measured width and the measured height.

void

[onOverScrolled](/reference/android/view/View#onOverScrolled%28int,%20int,%20boolean,%20boolean%29)(int scrollX, int scrollY, boolean clampedX, boolean clampedY)

Called by [overScrollBy(int, int, int, int, int, int, int, int, boolean)](/reference/android/view/View#overScrollBy%28int,%20int,%20int,%20int,%20int,%20int,%20int,%20int,%20boolean%29) to respond to the results of an over-scroll operation.

void

[onPointerCaptureChange](/reference/android/view/View#onPointerCaptureChange%28boolean%29)(boolean hasCapture)

Called when the window has just acquired or lost pointer capture.

void

[onPopulateAccessibilityEvent](/reference/android/view/View#onPopulateAccessibilityEvent%28android.view.accessibility.AccessibilityEvent%29)([AccessibilityEvent](/reference/android/view/accessibility/AccessibilityEvent) event)

Called from [dispatchPopulateAccessibilityEvent(AccessibilityEvent)](/reference/android/view/View#dispatchPopulateAccessibilityEvent%28android.view.accessibility.AccessibilityEvent%29) giving a chance to this View to populate the accessibility event with its text content.

void

[onProvideAutofillStructure](/reference/android/view/View#onProvideAutofillStructure%28android.view.ViewStructure,%20int%29)([ViewStructure](/reference/android/view/ViewStructure) structure, int flags)

Populates a [ViewStructure](/reference/android/view/ViewStructure) to fullfil an autofill request.

void

[onProvideAutofillVirtualStructure](/reference/android/view/View#onProvideAutofillVirtualStructure%28android.view.ViewStructure,%20int%29)([ViewStructure](/reference/android/view/ViewStructure) structure, int flags)

Populates a [ViewStructure](/reference/android/view/ViewStructure) containing virtual children to fullfil an autofill request.

void

[onProvideContentCaptureStructure](/reference/android/view/View#onProvideContentCaptureStructure%28android.view.ViewStructure,%20int%29)([ViewStructure](/reference/android/view/ViewStructure) structure, int flags)

Populates a [ViewStructure](/reference/android/view/ViewStructure) for content capture.

void

[onProvideStructure](/reference/android/view/View#onProvideStructure%28android.view.ViewStructure%29)([ViewStructure](/reference/android/view/ViewStructure) structure)

Called when assist structure is being retrieved from a view as part of[Activity.onProvideAssistData](/reference/android/app/Activity#onProvideAssistData%28android.os.Bundle%29).

void

[onProvideVirtualStructure](/reference/android/view/View#onProvideVirtualStructure%28android.view.ViewStructure%29)([ViewStructure](/reference/android/view/ViewStructure) structure)

Called when assist structure is being retrieved from a view as part of[Activity.onProvideAssistData](/reference/android/app/Activity#onProvideAssistData%28android.os.Bundle%29) to generate additional virtual structure under this view.

[ContentInfo](/reference/android/view/ContentInfo)

[onReceiveContent](/reference/android/view/View#onReceiveContent%28android.view.ContentInfo%29)([ContentInfo](/reference/android/view/ContentInfo) payload)

Implements the default behavior for receiving content for this type of view.

[PointerIcon](/reference/android/view/PointerIcon)

[onResolvePointerIcon](/reference/android/view/View#onResolvePointerIcon%28android.view.MotionEvent,%20int%29)([MotionEvent](/reference/android/view/MotionEvent) event, int pointerIndex)

Resolve the pointer icon that should be used for specified pointer in the motion event.

void

[onRestoreInstanceState](/reference/android/view/View#onRestoreInstanceState%28android.os.Parcelable%29)([Parcelable](/reference/android/os/Parcelable) state)

Hook allowing a view to re-apply a representation of its internal state that had previously been generated by [onSaveInstanceState()](/reference/android/view/View#onSaveInstanceState%28%29).

void

[onRtlPropertiesChanged](/reference/android/view/View#onRtlPropertiesChanged%28int%29)(int layoutDirection)

Called when any RTL property (layout direction or text direction or text alignment) has been changed.

[Parcelable](/reference/android/os/Parcelable)

[onSaveInstanceState](/reference/android/view/View#onSaveInstanceState%28%29)()

Hook allowing a view to generate a representation of its internal state that can later be used to create a new instance with that same state.

void

[onScreenStateChanged](/reference/android/view/View#onScreenStateChanged%28int%29)(int screenState)

This method is called whenever the state of the screen this view is attached to changes.

void

[onScrollCaptureSearch](/reference/android/view/View#onScrollCaptureSearch%28android.graphics.Rect,%20android.graphics.Point,%20java.util.function.Consumer<android.view.ScrollCaptureTarget>%29)([Rect](/reference/android/graphics/Rect) localVisibleRect, [Point](/reference/android/graphics/Point) windowOffset, [Consumer](/reference/java/util/function/Consumer)<[ScrollCaptureTarget](/reference/android/view/ScrollCaptureTarget)> targets)

Called when scroll capture is requested, to search for appropriate content to scroll.

void

[onScrollChanged](/reference/android/view/View#onScrollChanged%28int,%20int,%20int,%20int%29)(int l, int t, int oldl, int oldt)

This is called in response to an internal scroll in this view (i.e., the view scrolled its own contents).

boolean

[onSetAlpha](/reference/android/view/View#onSetAlpha%28int%29)(int alpha)

Invoked if there is a Transform that involves alpha.

void

[onSizeChanged](/reference/android/view/View#onSizeChanged%28int,%20int,%20int,%20int%29)(int w, int h, int oldw, int oldh)

This is called during layout when the size of this view has changed.

void

[onStartTemporaryDetach](/reference/android/view/View#onStartTemporaryDetach%28%29)()

This is called when a container is going to temporarily detach a child, with[ViewGroup.detachViewFromParent](/reference/android/view/ViewGroup#detachViewFromParent%28android.view.View%29).

boolean

[onTouchEvent](/reference/android/view/View#onTouchEvent%28android.view.MotionEvent%29)([MotionEvent](/reference/android/view/MotionEvent) event)

Implement this method to handle pointer events.

boolean

[onTrackballEvent](/reference/android/view/View#onTrackballEvent%28android.view.MotionEvent%29)([MotionEvent](/reference/android/view/MotionEvent) event)

Implement this method to handle trackball motion events.

void

[onViewTranslationResponse](/reference/android/view/View#onViewTranslationResponse%28android.view.translation.ViewTranslationResponse%29)([ViewTranslationResponse](/reference/android/view/translation/ViewTranslationResponse) response)

Called when the content from [View.onCreateViewTranslationRequest](/reference/android/view/View#onCreateViewTranslationRequest%28int[],%20java.util.function.Consumer<android.view.translation.ViewTranslationRequest>%29) had been translated by the TranslationService.

void

[onVirtualViewTranslationResponses](/reference/android/view/View#onVirtualViewTranslationResponses%28android.util.LongSparseArray<android.view.translation.ViewTranslationResponse>%29)([LongSparseArray](/reference/android/util/LongSparseArray)<[ViewTranslationResponse](/reference/android/view/translation/ViewTranslationResponse)> response)

Called when the content from [View.onCreateVirtualViewTranslationRequests](/reference/android/view/View#onCreateVirtualViewTranslationRequests%28long[],%20int[],%20java.util.function.Consumer<android.view.translation.ViewTranslationRequest>%29) had been translated by the TranslationService.

void

[onVisibilityAggregated](/reference/android/view/View#onVisibilityAggregated%28boolean%29)(boolean isVisible)

Called when the user-visibility of this View is potentially affected by a change to this view itself, an ancestor view or the window this view is attached to.

void

[onVisibilityChanged](/reference/android/view/View#onVisibilityChanged%28android.view.View,%20int%29)([View](/reference/android/view/View) changedView, int visibility)

Called when the visibility of the view or an ancestor of the view has changed.

void

[onWindowFocusChanged](/reference/android/view/View#onWindowFocusChanged%28boolean%29)(boolean hasWindowFocus)

Called when the window containing this view gains or loses focus.

void

[onWindowSystemUiVisibilityChanged](/reference/android/view/View#onWindowSystemUiVisibilityChanged%28int%29)(int visible)

This method was deprecated in API level 30. SystemUiVisibility flags are deprecated. Use [WindowInsetsController](/reference/android/view/WindowInsetsController) instead.

void

[onWindowVisibilityChanged](/reference/android/view/View#onWindowVisibilityChanged%28int%29)(int visibility)

Called when the window containing has change its visibility (between [GONE](/reference/android/view/View#GONE), [INVISIBLE](/reference/android/view/View#INVISIBLE), and [VISIBLE](/reference/android/view/View#VISIBLE)).

boolean

[overScrollBy](/reference/android/view/View#overScrollBy%28int,%20int,%20int,%20int,%20int,%20int,%20int,%20int,%20boolean%29)(int deltaX, int deltaY, int scrollX, int scrollY, int scrollRangeX, int scrollRangeY, int maxOverScrollX, int maxOverScrollY, boolean isTouchEvent)

Scroll the view with standard behavior for scrolling beyond the normal content boundaries.

boolean

[performAccessibilityAction](/reference/android/view/View#performAccessibilityAction%28int,%20android.os.Bundle%29)(int action, [Bundle](/reference/android/os/Bundle) arguments)

Performs the specified accessibility action on the view.

boolean

[performClick](/reference/android/view/View#performClick%28%29)()

Call this view's OnClickListener, if it is defined.

boolean

[performContextClick](/reference/android/view/View#performContextClick%28float,%20float%29)(float x, float y)

Call this view's OnContextClickListener, if it is defined.

boolean

[performContextClick](/reference/android/view/View#performContextClick%28%29)()

Call this view's OnContextClickListener, if it is defined.

boolean

[performHapticFeedback](/reference/android/view/View#performHapticFeedback%28int%29)(int feedbackConstant)

BZZZTT!!1!

Provide haptic feedback to the user for this view.

boolean

[performHapticFeedback](/reference/android/view/View#performHapticFeedback%28android.os.vibrator.HapticFeedbackRequest%29)([HapticFeedbackRequest](/reference/android/os/vibrator/HapticFeedbackRequest) request)

Like [performHapticFeedback(int, int)](/reference/android/view/View#performHapticFeedback%28int,%20int%29), but takes a [HapticFeedbackRequest](/reference/android/os/vibrator/HapticFeedbackRequest).

boolean

[performHapticFeedback](/reference/android/view/View#performHapticFeedback%28int,%20int%29)(int feedbackConstant, int flags)

BZZZTT!!1!

Like [performHapticFeedback(int)](/reference/android/view/View#performHapticFeedback%28int%29), with additional options.

boolean

[performLongClick](/reference/android/view/View#performLongClick%28float,%20float%29)(float x, float y)

Calls this view's OnLongClickListener, if it is defined.

boolean

[performLongClick](/reference/android/view/View#performLongClick%28%29)()

Calls this view's OnLongClickListener, if it is defined.

[ContentInfo](/reference/android/view/ContentInfo)

[performReceiveContent](/reference/android/view/View#performReceiveContent%28android.view.ContentInfo%29)([ContentInfo](/reference/android/view/ContentInfo) payload)

Receives the given content.

void

[playSoundEffect](/reference/android/view/View#playSoundEffect%28int%29)(int soundConstant)

Play a sound effect for this view.

boolean

[post](/reference/android/view/View#post%28java.lang.Runnable%29)([Runnable](/reference/java/lang/Runnable) action)

Causes the Runnable to be added to the message queue.

boolean

[postDelayed](/reference/android/view/View#postDelayed%28java.lang.Runnable,%20long%29)([Runnable](/reference/java/lang/Runnable) action, long delayMillis)

Causes the Runnable to be added to the message queue, to be run after the specified amount of time elapses.

void

[postInvalidate](/reference/android/view/View#postInvalidate%28%29)()

Cause an invalidate to happen on a subsequent cycle through the event loop.

void

[postInvalidate](/reference/android/view/View#postInvalidate%28int,%20int,%20int,%20int%29)(int left, int top, int right, int bottom)

Cause an invalidate of the specified area to happen on a subsequent cycle through the event loop.

void

[postInvalidateDelayed](/reference/android/view/View#postInvalidateDelayed%28long,%20int,%20int,%20int,%20int%29)(long delayMilliseconds, int left, int top, int right, int bottom)

Cause an invalidate of the specified area to happen on a subsequent cycle through the event loop.

void

[postInvalidateDelayed](/reference/android/view/View#postInvalidateDelayed%28long%29)(long delayMilliseconds)

Cause an invalidate to happen on a subsequent cycle through the event loop.

void

[postInvalidateOnAnimation](/reference/android/view/View#postInvalidateOnAnimation%28int,%20int,%20int,%20int%29)(int left, int top, int right, int bottom)

Cause an invalidate of the specified area to happen on the next animation time step, typically the next display frame.

void

[postInvalidateOnAnimation](/reference/android/view/View#postInvalidateOnAnimation%28%29)()

Cause an invalidate to happen on the next animation time step, typically the next display frame.

void

[postOnAnimation](/reference/android/view/View#postOnAnimation%28java.lang.Runnable%29)([Runnable](/reference/java/lang/Runnable) action)

Causes the Runnable to execute on the next animation time step.

void

[postOnAnimationDelayed](/reference/android/view/View#postOnAnimationDelayed%28java.lang.Runnable,%20long%29)([Runnable](/reference/java/lang/Runnable) action, long delayMillis)

Causes the Runnable to execute on the next animation time step, after the specified amount of time elapses.

void

[refreshDrawableState](/reference/android/view/View#refreshDrawableState%28%29)()

Call this to force a view to update its drawable state.

static void

[registerCalledFromWrongThreadListener](/reference/android/view/View#registerCalledFromWrongThreadListener%28android.view.View.CalledFromWrongThreadListener%29)([View.CalledFromWrongThreadListener](/reference/android/view/View.CalledFromWrongThreadListener) listener)

Registers a listener that is notified when a View API is called from the wrong thread.

void

[releasePointerCapture](/reference/android/view/View#releasePointerCapture%28%29)()

Releases the pointer capture.

boolean

[removeCallbacks](/reference/android/view/View#removeCallbacks%28java.lang.Runnable%29)([Runnable](/reference/java/lang/Runnable) action)

Removes the specified Runnable from the message queue.

void

[removeOnAttachStateChangeListener](/reference/android/view/View#removeOnAttachStateChangeListener%28android.view.View.OnAttachStateChangeListener%29)([View.OnAttachStateChangeListener](/reference/android/view/View.OnAttachStateChangeListener) listener)

Remove a listener for attach state changes.

void

[removeOnLayoutChangeListener](/reference/android/view/View#removeOnLayoutChangeListener%28android.view.View.OnLayoutChangeListener%29)([View.OnLayoutChangeListener](/reference/android/view/View.OnLayoutChangeListener) listener)

Remove a listener for layout changes.

void

[removeOnUnhandledKeyEventListener](/reference/android/view/View#removeOnUnhandledKeyEventListener%28android.view.View.OnUnhandledKeyEventListener%29)([View.OnUnhandledKeyEventListener](/reference/android/view/View.OnUnhandledKeyEventListener) listener)

Removes a listener which will receive unhandled [KeyEvent](/reference/android/view/KeyEvent)s.

void

[reportAppJankStats](/reference/android/view/View#reportAppJankStats%28android.app.jank.AppJankStats%29)([AppJankStats](/reference/android/app/jank/AppJankStats) appJankStats)

Called from apps when they want to report jank stats to the system.

void

[requestApplyInsets](/reference/android/view/View#requestApplyInsets%28%29)()

Ask that a new dispatch of [onApplyWindowInsets(WindowInsets)](/reference/android/view/View#onApplyWindowInsets%28android.view.WindowInsets%29) be performed.

void

[requestFitSystemWindows](/reference/android/view/View#requestFitSystemWindows%28%29)()

This method was deprecated in API level 20. Use [requestApplyInsets()](/reference/android/view/View#requestApplyInsets%28%29) for newer platform versions.

final boolean

[requestFocus](/reference/android/view/View#requestFocus%28int%29)(int direction)

Call this to try to give focus to a specific view or to one of its descendants and give it a hint about what direction focus is heading.

final boolean

[requestFocus](/reference/android/view/View#requestFocus%28%29)()

Call this to try to give focus to a specific view or to one of its descendants.

boolean

[requestFocus](/reference/android/view/View#requestFocus%28int,%20android.graphics.Rect%29)(int direction, [Rect](/reference/android/graphics/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.

final boolean

[requestFocusFromTouch](/reference/android/view/View#requestFocusFromTouch%28%29)()

Call this to try to give focus to a specific view or to one of its descendants.

void

[requestLayout](/reference/android/view/View#requestLayout%28%29)()

Call this when something has changed which has invalidated the layout of this view.

void

[requestPointerCapture](/reference/android/view/View#requestPointerCapture%28%29)()

Requests pointer capture in relative mode.

void

[requestPointerCapture](/reference/android/view/View#requestPointerCapture%28int%29)(int mode)

Requests pointer capture in the specified mode.

boolean

[requestRectangleOnScreen](/reference/android/view/View#requestRectangleOnScreen%28android.graphics.Rect,%20boolean,%20int%29)([Rect](/reference/android/graphics/Rect) rectangle, boolean immediate, int source)

Request that a rectangle of this view be visible on the screen, scrolling if necessary just enough.

boolean

[requestRectangleOnScreen](/reference/android/view/View#requestRectangleOnScreen%28android.graphics.Rect%29)([Rect](/reference/android/graphics/Rect) rectangle)

Request that a rectangle of this view be visible on the screen, scrolling if necessary just enough.

boolean

[requestRectangleOnScreen](/reference/android/view/View#requestRectangleOnScreen%28android.graphics.Rect,%20boolean%29)([Rect](/reference/android/graphics/Rect) rectangle, boolean immediate)

Request that a rectangle of this view be visible on the screen, scrolling if necessary just enough.

final void

[requestUnbufferedDispatch](/reference/android/view/View#requestUnbufferedDispatch%28int%29)(int source)

Request unbuffered dispatch of the given event source class to this view.

final void

[requestUnbufferedDispatch](/reference/android/view/View#requestUnbufferedDispatch%28android.view.MotionEvent%29)([MotionEvent](/reference/android/view/MotionEvent) event)

Request unbuffered dispatch of the given stream of MotionEvents to this View.

final <T extends [View](/reference/android/view/View)> T

[requireViewById](/reference/android/view/View#requireViewById%28int%29)(int id)

Finds the first descendant view with the given ID, the view itself if the ID matches[getId()](/reference/android/view/View#getId%28%29), or throws an IllegalArgumentException if the ID is invalid or there is no matching view in the hierarchy.

void

[resetPivot](/reference/android/view/View#resetPivot%28%29)()

Clears any pivot previously set by a call to [setPivotX(float)](/reference/android/view/View#setPivotX%28float%29) or[setPivotY(float)](/reference/android/view/View#setPivotY%28float%29).

static int

[resolveSize](/reference/android/view/View#resolveSize%28int,%20int%29)(int size, int measureSpec)

Version of [resolveSizeAndState(int, int, int)](/reference/android/view/View#resolveSizeAndState%28int,%20int,%20int%29) returning only the [MEASURED_SIZE_MASK](/reference/android/view/View#MEASURED%5FSIZE%5FMASK) bits of the result.

static int

[resolveSizeAndState](/reference/android/view/View#resolveSizeAndState%28int,%20int,%20int%29)(int size, int measureSpec, int childMeasuredState)

Utility to reconcile a desired size and state, with constraints imposed by a MeasureSpec.

boolean

[restoreDefaultFocus](/reference/android/view/View#restoreDefaultFocus%28%29)()

Gives focus to the default-focus view in the view hierarchy that has this view as a root.

void

[restoreHierarchyState](/reference/android/view/View#restoreHierarchyState%28android.util.SparseArray<android.os.Parcelable>%29)([SparseArray](/reference/android/util/SparseArray)<[Parcelable](/reference/android/os/Parcelable)> container)

Restore this view hierarchy's frozen state from the given container.

final void

[saveAttributeDataForStyleable](/reference/android/view/View#saveAttributeDataForStyleable%28android.content.Context,%20int[],%20android.util.AttributeSet,%20android.content.res.TypedArray,%20int,%20int%29)([Context](/reference/android/content/Context) context, int[] styleable, [AttributeSet](/reference/android/util/AttributeSet) attrs, [TypedArray](/reference/android/content/res/TypedArray) t, int defStyleAttr, int defStyleRes)

Stores debugging information about attributes.

void

[saveHierarchyState](/reference/android/view/View#saveHierarchyState%28android.util.SparseArray<android.os.Parcelable>%29)([SparseArray](/reference/android/util/SparseArray)<[Parcelable](/reference/android/os/Parcelable)> container)

Store this view hierarchy's frozen state into the given container.

void

[scheduleDrawable](/reference/android/view/View#scheduleDrawable%28android.graphics.drawable.Drawable,%20java.lang.Runnable,%20long%29)([Drawable](/reference/android/graphics/drawable/Drawable) who, [Runnable](/reference/java/lang/Runnable) what, long when)

Schedules an action on a drawable to occur at a specified time.

void

[scrollBy](/reference/android/view/View#scrollBy%28int,%20int%29)(int x, int y)

Move the scrolled position of your view.

void

[scrollTo](/reference/android/view/View#scrollTo%28int,%20int%29)(int x, int y)

Set the scrolled position of your view.

void

[sendAccessibilityEvent](/reference/android/view/View#sendAccessibilityEvent%28int%29)(int eventType)

Sends an accessibility event of the given type.

void

[sendAccessibilityEventUnchecked](/reference/android/view/View#sendAccessibilityEventUnchecked%28android.view.accessibility.AccessibilityEvent%29)([AccessibilityEvent](/reference/android/view/accessibility/AccessibilityEvent) event)

This method behaves exactly as [sendAccessibilityEvent(int)](/reference/android/view/View#sendAccessibilityEvent%28int%29) but takes as an argument an empty [AccessibilityEvent](/reference/android/view/accessibility/AccessibilityEvent) and does not perform a check whether accessibility is enabled.

void

[setAccessibilityDataSensitive](/reference/android/view/View#setAccessibilityDataSensitive%28int%29)(int accessibilityDataSensitive)

Specifies whether this view should only allow interactions from[AccessibilityService](/reference/android/accessibilityservice/AccessibilityService)s with the[AccessibilityServiceInfo.isAccessibilityTool()](/reference/android/accessibilityservice/AccessibilityServiceInfo#isAccessibilityTool%28%29) property set to true.

void

[setAccessibilityDelegate](/reference/android/view/View#setAccessibilityDelegate%28android.view.View.AccessibilityDelegate%29)([View.AccessibilityDelegate](/reference/android/view/View.AccessibilityDelegate) delegate)

Sets a delegate for implementing accessibility support via composition (as opposed to inheritance).

void

[setAccessibilityHeading](/reference/android/view/View#setAccessibilityHeading%28boolean%29)(boolean isHeading)

Set if view is a heading for a section of content for accessibility purposes.

void

[setAccessibilityLiveRegion](/reference/android/view/View#setAccessibilityLiveRegion%28int%29)(int mode)

Sets the live region mode for this view.

void

[setAccessibilityPaneTitle](/reference/android/view/View#setAccessibilityPaneTitle%28java.lang.CharSequence%29)([CharSequence](/reference/java/lang/CharSequence) accessibilityPaneTitle)

Visually distinct portion of a window with window-like semantics are considered panes for accessibility purposes.

void

[setAccessibilityTraversalAfter](/reference/android/view/View#setAccessibilityTraversalAfter%28int%29)(int afterId)

Sets the id of a view that screen readers are requested to visit before this view.

void

[setAccessibilityTraversalBefore](/reference/android/view/View#setAccessibilityTraversalBefore%28int%29)(int beforeId)

Sets the id of a view that screen readers are requested to visit after this view.

void

[setActivated](/reference/android/view/View#setActivated%28boolean%29)(boolean activated)

Changes the activated state of this view.

void

[setAllowClickWhenDisabled](/reference/android/view/View#setAllowClickWhenDisabled%28boolean%29)(boolean clickableWhenDisabled)

Enables or disables click events for this view when disabled.

void

[setAllowedHandwritingDelegatePackage](/reference/android/view/View#setAllowedHandwritingDelegatePackage%28java.lang.String%29)([String](/reference/java/lang/String) allowedPackageName)

Specifies that this view may act as a handwriting initiation delegator for a delegate editor view from the specified package.

void

[setAllowedHandwritingDelegatorPackage](/reference/android/view/View#setAllowedHandwritingDelegatorPackage%28java.lang.String%29)([String](/reference/java/lang/String) allowedPackageName)

Specifies that a view from the specified package may act as a handwriting delegator for this delegate editor view.

void

[setAlpha](/reference/android/view/View#setAlpha%28float%29)(float alpha)

Sets the opacity of the view to a value from 0 to 1, where 0 means the view is completely transparent and 1 means the view is completely opaque.

void

[setAnimation](/reference/android/view/View#setAnimation%28android.view.animation.Animation%29)([Animation](/reference/android/view/animation/Animation) animation)

Sets the next animation to play for this view.

void

[setAnimationMatrix](/reference/android/view/View#setAnimationMatrix%28android.graphics.Matrix%29)([Matrix](/reference/android/graphics/Matrix) matrix)

Changes the transformation matrix on the view.

void

[setAutoHandwritingEnabled](/reference/android/view/View#setAutoHandwritingEnabled%28boolean%29)(boolean enabled)

Set whether this view enables automatic handwriting initiation.

void

[setAutofillHints](/reference/android/view/View#setAutofillHints%28java.lang.String[]%29)([String...](/reference/java/lang/String) autofillHints)

Sets the hints that help an [AutofillService](/reference/android/service/autofill/AutofillService) determine how to autofill the view with the user's data.

void

[setAutofillId](/reference/android/view/View#setAutofillId%28android.view.autofill.AutofillId%29)([AutofillId](/reference/android/view/autofill/AutofillId) id)

Sets the unique, logical identifier of this view in the activity, for autofill purposes.

void

[setBackground](/reference/android/view/View#setBackground%28android.graphics.drawable.Drawable%29)([Drawable](/reference/android/graphics/drawable/Drawable) background)

Set the background to a given Drawable, or remove the background.

void

[setBackgroundColor](/reference/android/view/View#setBackgroundColor%28int%29)(int color)

Sets the background color for this view.

void

[setBackgroundDrawable](/reference/android/view/View#setBackgroundDrawable%28android.graphics.drawable.Drawable%29)([Drawable](/reference/android/graphics/drawable/Drawable) background)

This method was deprecated in API level 16. use [setBackground(Drawable)](/reference/android/view/View#setBackground%28android.graphics.drawable.Drawable%29) instead

void

[setBackgroundResource](/reference/android/view/View#setBackgroundResource%28int%29)(int resid)

Set the background to a given resource.

void

[setBackgroundTintBlendMode](/reference/android/view/View#setBackgroundTintBlendMode%28android.graphics.BlendMode%29)([BlendMode](/reference/android/graphics/BlendMode) blendMode)

Specifies the blending mode used to apply the tint specified by[setBackgroundTintList(ColorStateList)](/reference/android/view/View#setBackgroundTintList%28android.content.res.ColorStateList%29)} to the background drawable.

void

[setBackgroundTintList](/reference/android/view/View#setBackgroundTintList%28android.content.res.ColorStateList%29)([ColorStateList](/reference/android/content/res/ColorStateList) tint)

Applies a tint to the background drawable.

void

[setBackgroundTintMode](/reference/android/view/View#setBackgroundTintMode%28android.graphics.PorterDuff.Mode%29)([PorterDuff.Mode](/reference/android/graphics/PorterDuff.Mode) tintMode)

Specifies the blending mode used to apply the tint specified by[setBackgroundTintList(ColorStateList)](/reference/android/view/View#setBackgroundTintList%28android.content.res.ColorStateList%29)} to the background drawable.

final void

[setBottom](/reference/android/view/View#setBottom%28int%29)(int bottom)

Sets the bottom position of this view relative to its parent.

void

[setCameraDistance](/reference/android/view/View#setCameraDistance%28float%29)(float distance)

Sets the distance along the Z axis (orthogonal to the X/Y plane on which views are drawn) from the camera to this view.

void

[setClickable](/reference/android/view/View#setClickable%28boolean%29)(boolean clickable)

Enables or disables click events for this view.

void

[setClipBounds](/reference/android/view/View#setClipBounds%28android.graphics.Rect%29)([Rect](/reference/android/graphics/Rect) clipBounds)

Sets a rectangular area on this view to which the view will be clipped when it is drawn.

void

[setClipToOutline](/reference/android/view/View#setClipToOutline%28boolean%29)(boolean clipToOutline)

Sets whether the View's Outline should be used to clip the contents of the View.

void

[setContentCaptureSession](/reference/android/view/View#setContentCaptureSession%28android.view.contentcapture.ContentCaptureSession%29)([ContentCaptureSession](/reference/android/view/contentcapture/ContentCaptureSession) contentCaptureSession)

Sets the (optional) [ContentCaptureSession](/reference/android/view/contentcapture/ContentCaptureSession) associated with this view.

void

[setContentDescription](/reference/android/view/View#setContentDescription%28java.lang.CharSequence%29)([CharSequence](/reference/java/lang/CharSequence) contentDescription)

Sets the [View](/reference/android/view/View)'s content description.

final void

[setContentSensitivity](/reference/android/view/View#setContentSensitivity%28int%29)(int mode)

Sets content sensitivity mode to determine whether this view displays sensitive content (e.g. username, password etc.).

void

[setContextClickable](/reference/android/view/View#setContextClickable%28boolean%29)(boolean contextClickable)

Enables or disables context clicking for this view.

void

[setDefaultFocusHighlightEnabled](/reference/android/view/View#setDefaultFocusHighlightEnabled%28boolean%29)(boolean defaultFocusHighlightEnabled)

Sets whether this View should use a default focus highlight when it gets focused but doesn't have [R.attr.state_focused](/reference/android/R.attr#state%5Ffocused) defined in its background.

void

[setDrawingCacheBackgroundColor](/reference/android/view/View#setDrawingCacheBackgroundColor%28int%29)(int color)

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, [setLayerType(int,Paint)](/reference/android/view/View#setLayerType%28int,%20android.graphics.Paint%29) 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](/reference/android/graphics/Canvas) from either a [Bitmap](/reference/android/graphics/Bitmap) or[Picture](/reference/android/graphics/Picture) and call [draw(Canvas)](/reference/android/view/View#draw%28android.graphics.Canvas%29) on the View. However these software-rendered usages are discouraged and have compatibility issues with hardware-only rendering features such as [Config.HARDWARE](/reference/android/graphics/Bitmap.Config#HARDWARE) bitmaps, real-time shadows, and outline clipping. For screenshots of the UI for feedback reports or unit testing the [PixelCopy](/reference/android/view/PixelCopy) API is recommended.

void

[setDrawingCacheEnabled](/reference/android/view/View#setDrawingCacheEnabled%28boolean%29)(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, [setLayerType(int,Paint)](/reference/android/view/View#setLayerType%28int,%20android.graphics.Paint%29) 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](/reference/android/graphics/Canvas) from either a [Bitmap](/reference/android/graphics/Bitmap) or[Picture](/reference/android/graphics/Picture) and call [draw(Canvas)](/reference/android/view/View#draw%28android.graphics.Canvas%29) on the View. However these software-rendered usages are discouraged and have compatibility issues with hardware-only rendering features such as [Config.HARDWARE](/reference/android/graphics/Bitmap.Config#HARDWARE) bitmaps, real-time shadows, and outline clipping. For screenshots of the UI for feedback reports or unit testing the [PixelCopy](/reference/android/view/PixelCopy) API is recommended.

void

[setDrawingCacheQuality](/reference/android/view/View#setDrawingCacheQuality%28int%29)(int quality)

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, [setLayerType(int,Paint)](/reference/android/view/View#setLayerType%28int,%20android.graphics.Paint%29) 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](/reference/android/graphics/Canvas) from either a [Bitmap](/reference/android/graphics/Bitmap) or[Picture](/reference/android/graphics/Picture) and call [draw(Canvas)](/reference/android/view/View#draw%28android.graphics.Canvas%29) on the View. However these software-rendered usages are discouraged and have compatibility issues with hardware-only rendering features such as [Config.HARDWARE](/reference/android/graphics/Bitmap.Config#HARDWARE) bitmaps, real-time shadows, and outline clipping. For screenshots of the UI for feedback reports or unit testing the [PixelCopy](/reference/android/view/PixelCopy) API is recommended.

void

[setDuplicateParentStateEnabled](/reference/android/view/View#setDuplicateParentStateEnabled%28boolean%29)(boolean enabled)

Enables or disables the duplication of the parent's state into this view.

void

[setElevation](/reference/android/view/View#setElevation%28float%29)(float elevation)

Sets the base elevation of this view, in pixels.

void

[setEnabled](/reference/android/view/View#setEnabled%28boolean%29)(boolean enabled)

Set the enabled state of this view.

void

[setFadingEdgeLength](/reference/android/view/View#setFadingEdgeLength%28int%29)(int length)

Set the size of the faded edge used to indicate that more content in this view is available.

void

[setFilterTouchesWhenObscured](/reference/android/view/View#setFilterTouchesWhenObscured%28boolean%29)(boolean enabled)

Sets whether the framework should discard touches when the view's window is obscured by another visible window at the touched location.

void

[setFitsSystemWindows](/reference/android/view/View#setFitsSystemWindows%28boolean%29)(boolean fitSystemWindows)

Sets whether or not this view should account for system screen decorations such as the status bar and inset its content; that is, controlling whether the default implementation of [fitSystemWindows(Rect)](/reference/android/view/View#fitSystemWindows%28android.graphics.Rect%29) will be executed.

void

[setFocusable](/reference/android/view/View#setFocusable%28boolean%29)(boolean focusable)

Set whether this view can receive the focus.

void

[setFocusable](/reference/android/view/View#setFocusable%28int%29)(int focusable)

Sets whether this view can receive focus.

void

[setFocusableInTouchMode](/reference/android/view/View#setFocusableInTouchMode%28boolean%29)(boolean focusableInTouchMode)

Set whether this view can receive focus while in touch mode.

void

[setFocusedByDefault](/reference/android/view/View#setFocusedByDefault%28boolean%29)(boolean isFocusedByDefault)

Sets whether this View should receive focus when the focus is restored for the view hierarchy containing this view.

void

[setForceDarkAllowed](/reference/android/view/View#setForceDarkAllowed%28boolean%29)(boolean allow)

Sets whether or not to allow force dark to apply to this view.

void

[setForeground](/reference/android/view/View#setForeground%28android.graphics.drawable.Drawable%29)([Drawable](/reference/android/graphics/drawable/Drawable) foreground)

Supply a Drawable that is to be rendered on top of all of the content in the view.

void

[setForegroundGravity](/reference/android/view/View#setForegroundGravity%28int%29)(int gravity)

Describes how the foreground is positioned.

void

[setForegroundTintBlendMode](/reference/android/view/View#setForegroundTintBlendMode%28android.graphics.BlendMode%29)([BlendMode](/reference/android/graphics/BlendMode) blendMode)

Specifies the blending mode used to apply the tint specified by[setForegroundTintList(ColorStateList)](/reference/android/view/View#setForegroundTintList%28android.content.res.ColorStateList%29)} to the background drawable.

void

[setForegroundTintList](/reference/android/view/View#setForegroundTintList%28android.content.res.ColorStateList%29)([ColorStateList](/reference/android/content/res/ColorStateList) tint)

Applies a tint to the foreground drawable.

void

[setForegroundTintMode](/reference/android/view/View#setForegroundTintMode%28android.graphics.PorterDuff.Mode%29)([PorterDuff.Mode](/reference/android/graphics/PorterDuff.Mode) tintMode)

Specifies the blending mode used to apply the tint specified by[setForegroundTintList(ColorStateList)](/reference/android/view/View#setForegroundTintList%28android.content.res.ColorStateList%29)} to the background drawable.

void

[setFrameContentVelocity](/reference/android/view/View#setFrameContentVelocity%28float%29)(float pixelsPerSecond)

Set the current velocity of the View, we only track positive value.

void

[setHandwritingBoundsOffsets](/reference/android/view/View#setHandwritingBoundsOffsets%28float,%20float,%20float,%20float%29)(float offsetLeft, float offsetTop, float offsetRight, float offsetBottom)

Set the amount of offset applied to this view's stylus handwriting bounds.

void

[setHandwritingDelegateFlags](/reference/android/view/View#setHandwritingDelegateFlags%28int%29)(int flags)

Sets flags configuring the handwriting delegation behavior for this delegate editor view.

void

[setHandwritingDelegatorCallback](/reference/android/view/View#setHandwritingDelegatorCallback%28java.lang.Runnable%29)([Runnable](/reference/java/lang/Runnable) callback)

Sets a callback which should be called when a stylus [MotionEvent](/reference/android/view/MotionEvent) occurs within this view's bounds.

void

[setHapticFeedbackEnabled](/reference/android/view/View#setHapticFeedbackEnabled%28boolean%29)(boolean hapticFeedbackEnabled)

Set whether this view should have haptic feedback for events such as long presses.

void

[setHasTransientState](/reference/android/view/View#setHasTransientState%28boolean%29)(boolean hasTransientState)

Set whether this view is currently tracking transient state that the framework should attempt to preserve when possible.

void

[setHorizontalFadingEdgeEnabled](/reference/android/view/View#setHorizontalFadingEdgeEnabled%28boolean%29)(boolean horizontalFadingEdgeEnabled)

Define whether the horizontal edges should be faded when this view is scrolled horizontally.

void

[setHorizontalScrollBarEnabled](/reference/android/view/View#setHorizontalScrollBarEnabled%28boolean%29)(boolean horizontalScrollBarEnabled)

Define whether the horizontal scrollbar should be drawn or not.

void

[setHorizontalScrollbarThumbDrawable](/reference/android/view/View#setHorizontalScrollbarThumbDrawable%28android.graphics.drawable.Drawable%29)([Drawable](/reference/android/graphics/drawable/Drawable) drawable)

Defines the horizontal thumb drawable

void

[setHorizontalScrollbarTrackDrawable](/reference/android/view/View#setHorizontalScrollbarTrackDrawable%28android.graphics.drawable.Drawable%29)([Drawable](/reference/android/graphics/drawable/Drawable) drawable)

Defines the horizontal track drawable

void

[setHovered](/reference/android/view/View#setHovered%28boolean%29)(boolean hovered)

Sets whether the view is currently hovered.

void

[setId](/reference/android/view/View#setId%28int%29)(int id)

Sets the identifier for this view.

void

[setImportantForAccessibility](/reference/android/view/View#setImportantForAccessibility%28int%29)(int mode)

Sets how to determine whether this view is important for accessibility which is if it fires accessibility events and if it is reported to accessibility services that query the screen.

void

[setImportantForAutofill](/reference/android/view/View#setImportantForAutofill%28int%29)(int mode)

Sets the mode for determining whether this view is considered important for autofill.

void

[setImportantForContentCapture](/reference/android/view/View#setImportantForContentCapture%28int%29)(int mode)

Sets the mode for determining whether this view is considered important for content capture.

void

[setIsCredential](/reference/android/view/View#setIsCredential%28boolean%29)(boolean isCredential)

This method was deprecated in API level 37. The [isCredential()](/reference/android/view/View#isCredential%28%29) is no longer used by the system and is not recommended for use by apps. The purpose and usage expectations of this property were never clearly defined.

void

[setIsHandwritingDelegate](/reference/android/view/View#setIsHandwritingDelegate%28boolean%29)(boolean isHandwritingDelegate)

Sets this view to be a handwriting delegate.

void

[setKeepScreenOn](/reference/android/view/View#setKeepScreenOn%28boolean%29)(boolean keepScreenOn)

Controls whether the screen should remain on, modifying the value of [KEEP_SCREEN_ON](/reference/android/view/View#KEEP%5FSCREEN%5FON).

void

[setKeyboardNavigationCluster](/reference/android/view/View#setKeyboardNavigationCluster%28boolean%29)(boolean isCluster)

Set whether this view is a root of a keyboard navigation cluster.

void

[setLabelFor](/reference/android/view/View#setLabelFor%28int%29)(int id)

Sets the id of a view for which this view serves as a label for accessibility purposes.

void

[setLayerPaint](/reference/android/view/View#setLayerPaint%28android.graphics.Paint%29)([Paint](/reference/android/graphics/Paint) paint)

Updates the [Paint](/reference/android/graphics/Paint) object used with the current layer (used only if the current layer type is not set to [LAYER_TYPE_NONE](/reference/android/view/View#LAYER%5FTYPE%5FNONE)).

void

[setLayerType](/reference/android/view/View#setLayerType%28int,%20android.graphics.Paint%29)(int layerType, [Paint](/reference/android/graphics/Paint) paint)

Specifies the type of layer backing this view.

void

[setLayoutDirection](/reference/android/view/View#setLayoutDirection%28int%29)(int layoutDirection)

Set the layout direction for this view.

void

[setLayoutParams](/reference/android/view/View#setLayoutParams%28android.view.ViewGroup.LayoutParams%29)([ViewGroup.LayoutParams](/reference/android/view/ViewGroup.LayoutParams) params)

Set the layout parameters associated with this view.

final void

[setLeft](/reference/android/view/View#setLeft%28int%29)(int left)

Sets the left position of this view relative to its parent.

final void

[setLeftTopRightBottom](/reference/android/view/View#setLeftTopRightBottom%28int,%20int,%20int,%20int%29)(int left, int top, int right, int bottom)

Assign a size and position to this view.

void

[setLongClickable](/reference/android/view/View#setLongClickable%28boolean%29)(boolean longClickable)

Enables or disables long click events for this view.

final void

[setMeasuredDimension](/reference/android/view/View#setMeasuredDimension%28int,%20int%29)(int measuredWidth, int measuredHeight)

This method must be called by [onMeasure(int, int)](/reference/android/view/View#onMeasure%28int,%20int%29) to store the measured width and measured height.

void

[setMinimumHeight](/reference/android/view/View#setMinimumHeight%28int%29)(int minHeight)

Sets the minimum height of the view.

void

[setMinimumWidth](/reference/android/view/View#setMinimumWidth%28int%29)(int minWidth)

Sets the minimum width of the view.

void

[setNestedScrollingEnabled](/reference/android/view/View#setNestedScrollingEnabled%28boolean%29)(boolean enabled)

Enable or disable nested scrolling for this view.

void

[setNextClusterForwardId](/reference/android/view/View#setNextClusterForwardId%28int%29)(int nextClusterForwardId)

Sets the id of the view to use as the root of the next keyboard navigation cluster.

void

[setNextFocusDownId](/reference/android/view/View#setNextFocusDownId%28int%29)(int nextFocusDownId)

Sets the id of the view to use when the next focus is [FOCUS_DOWN](/reference/android/view/View#FOCUS%5FDOWN).

void

[setNextFocusForwardId](/reference/android/view/View#setNextFocusForwardId%28int%29)(int nextFocusForwardId)

Sets the id of the view to use when the next focus is [FOCUS_FORWARD](/reference/android/view/View#FOCUS%5FFORWARD).

void

[setNextFocusLeftId](/reference/android/view/View#setNextFocusLeftId%28int%29)(int nextFocusLeftId)

Sets the id of the view to use when the next focus is [FOCUS_LEFT](/reference/android/view/View#FOCUS%5FLEFT).

void

[setNextFocusRightId](/reference/android/view/View#setNextFocusRightId%28int%29)(int nextFocusRightId)

Sets the id of the view to use when the next focus is [FOCUS_RIGHT](/reference/android/view/View#FOCUS%5FRIGHT).

void

[setNextFocusUpId](/reference/android/view/View#setNextFocusUpId%28int%29)(int nextFocusUpId)

Sets the id of the view to use when the next focus is [FOCUS_UP](/reference/android/view/View#FOCUS%5FUP).

void

[setOnApplyWindowInsetsListener](/reference/android/view/View#setOnApplyWindowInsetsListener%28android.view.View.OnApplyWindowInsetsListener%29)([View.OnApplyWindowInsetsListener](/reference/android/view/View.OnApplyWindowInsetsListener) listener)

Set an [OnApplyWindowInsetsListener](/reference/android/view/View.OnApplyWindowInsetsListener) to take over the policy for applying window insets to this view.

void

[setOnCapturedPointerListener](/reference/android/view/View#setOnCapturedPointerListener%28android.view.View.OnCapturedPointerListener%29)([View.OnCapturedPointerListener](/reference/android/view/View.OnCapturedPointerListener) l)

Set a listener to receive callbacks when the pointer capture state of a view changes.

void

[setOnClickListener](/reference/android/view/View#setOnClickListener%28android.view.View.OnClickListener%29)([View.OnClickListener](/reference/android/view/View.OnClickListener) l)

Register a callback to be invoked when this view is clicked.

void

[setOnContextClickListener](/reference/android/view/View#setOnContextClickListener%28android.view.View.OnContextClickListener%29)([View.OnContextClickListener](/reference/android/view/View.OnContextClickListener) l)

Register a callback to be invoked when this view is context clicked.

void

[setOnCreateContextMenuListener](/reference/android/view/View#setOnCreateContextMenuListener%28android.view.View.OnCreateContextMenuListener%29)([View.OnCreateContextMenuListener](/reference/android/view/View.OnCreateContextMenuListener) l)

Register a callback to be invoked when the context menu for this view is being built.

void

[setOnDragListener](/reference/android/view/View#setOnDragListener%28android.view.View.OnDragListener%29)([View.OnDragListener](/reference/android/view/View.OnDragListener) l)

Register a drag event listener callback object for this View.

void

[setOnFocusChangeListener](/reference/android/view/View#setOnFocusChangeListener%28android.view.View.OnFocusChangeListener%29)([View.OnFocusChangeListener](/reference/android/view/View.OnFocusChangeListener) l)

Register a callback to be invoked when focus of this view changed.

void

[setOnGenericMotionListener](/reference/android/view/View#setOnGenericMotionListener%28android.view.View.OnGenericMotionListener%29)([View.OnGenericMotionListener](/reference/android/view/View.OnGenericMotionListener) l)

Register a callback to be invoked when a generic motion event is sent to this view.

void

[setOnHoverListener](/reference/android/view/View#setOnHoverListener%28android.view.View.OnHoverListener%29)([View.OnHoverListener](/reference/android/view/View.OnHoverListener) l)

Register a callback to be invoked when a hover event is sent to this view.

void

[setOnKeyListener](/reference/android/view/View#setOnKeyListener%28android.view.View.OnKeyListener%29)([View.OnKeyListener](/reference/android/view/View.OnKeyListener) l)

Register a callback to be invoked when a hardware key is pressed in this view.

void

[setOnLongClickListener](/reference/android/view/View#setOnLongClickListener%28android.view.View.OnLongClickListener%29)([View.OnLongClickListener](/reference/android/view/View.OnLongClickListener) l)

Register a callback to be invoked when this view is clicked and held.

void

[setOnReceiveContentListener](/reference/android/view/View#setOnReceiveContentListener%28java.lang.String[],%20android.view.OnReceiveContentListener%29)([String[]](/reference/java/lang/String) mimeTypes, [OnReceiveContentListener](/reference/android/view/OnReceiveContentListener) listener)

Sets the listener to be [used](/reference/android/view/View#performReceiveContent%28android.view.ContentInfo%29) to handle insertion of content into this view.

void

[setOnScrollChangeListener](/reference/android/view/View#setOnScrollChangeListener%28android.view.View.OnScrollChangeListener%29)([View.OnScrollChangeListener](/reference/android/view/View.OnScrollChangeListener) l)

Register a callback to be invoked when the scroll X or Y positions of this view change.

void

[setOnSystemUiVisibilityChangeListener](/reference/android/view/View#setOnSystemUiVisibilityChangeListener%28android.view.View.OnSystemUiVisibilityChangeListener%29)([View.OnSystemUiVisibilityChangeListener](/reference/android/view/View.OnSystemUiVisibilityChangeListener) l)

This method was deprecated in API level 30. Use [WindowInsets.isVisible(int)](/reference/android/view/WindowInsets#isVisible%28int%29) to find out about system bar visibilities by setting a [OnApplyWindowInsetsListener](/reference/android/view/View.OnApplyWindowInsetsListener) on this view.

void

[setOnTouchListener](/reference/android/view/View#setOnTouchListener%28android.view.View.OnTouchListener%29)([View.OnTouchListener](/reference/android/view/View.OnTouchListener) l)

Register a callback to be invoked when a touch event is sent to this view.

void

[setOutlineAmbientShadowColor](/reference/android/view/View#setOutlineAmbientShadowColor%28int%29)(int color)

Sets the color of the ambient shadow that is drawn when the view has a positive Z or elevation value.

void

[setOutlineProvider](/reference/android/view/View#setOutlineProvider%28android.view.ViewOutlineProvider%29)([ViewOutlineProvider](/reference/android/view/ViewOutlineProvider) provider)

Sets the [ViewOutlineProvider](/reference/android/view/ViewOutlineProvider) of the view, which generates the Outline that defines the shape of the shadow it casts, and enables outline clipping.

void

[setOutlineSpotShadowColor](/reference/android/view/View#setOutlineSpotShadowColor%28int%29)(int color)

Sets the color of the spot shadow that is drawn when the view has a positive Z or elevation value.

void

[setOverScrollMode](/reference/android/view/View#setOverScrollMode%28int%29)(int overScrollMode)

Set the over-scroll mode for this view.

void

[setPadding](/reference/android/view/View#setPadding%28int,%20int,%20int,%20int%29)(int left, int top, int right, int bottom)

Sets the padding.

void

[setPaddingRelative](/reference/android/view/View#setPaddingRelative%28int,%20int,%20int,%20int%29)(int start, int top, int end, int bottom)

Sets the relative padding.

void

[setPendingCredentialRequest](/reference/android/view/View#setPendingCredentialRequest%28android.credentials.GetCredentialRequest,%20android.os.OutcomeReceiver<android.credentials.GetCredentialResponse,android.credentials.GetCredentialException>%29)([GetCredentialRequest](/reference/android/credentials/GetCredentialRequest) request, [OutcomeReceiver](/reference/android/os/OutcomeReceiver)<[GetCredentialResponse](/reference/android/credentials/GetCredentialResponse), [GetCredentialException](/reference/android/credentials/GetCredentialException)> callback)

Sets a [CredentialManager](/reference/android/credentials/CredentialManager) request to retrieve credentials, when the user focuses on this given view.

void

[setPivotX](/reference/android/view/View#setPivotX%28float%29)(float pivotX)

Sets the x location of the point around which the view is[rotated](/reference/android/view/View#setRotation%28float%29) and [scaled](/reference/android/view/View#setScaleX%28float%29).

void

[setPivotY](/reference/android/view/View#setPivotY%28float%29)(float pivotY)

Sets the y location of the point around which the view is [rotated](/reference/android/view/View#setRotation%28float%29) and [scaled](/reference/android/view/View#setScaleY%28float%29).

void

[setPointerIcon](/reference/android/view/View#setPointerIcon%28android.view.PointerIcon%29)([PointerIcon](/reference/android/view/PointerIcon) pointerIcon)

Set the pointer icon to be used for a mouse pointer in the current view.

final void

[setPreferKeepClear](/reference/android/view/View#setPreferKeepClear%28boolean%29)(boolean preferKeepClear)

Set a preference to keep the bounds of this view clear from floating windows above this view's window.

final void

[setPreferKeepClearRects](/reference/android/view/View#setPreferKeepClearRects%28java.util.List<android.graphics.Rect>%29)([List](/reference/java/util/List)<[Rect](/reference/android/graphics/Rect)> rects)

Set a preference to keep the provided rects clear from floating windows above this view's window.

void

[setPressed](/reference/android/view/View#setPressed%28boolean%29)(boolean pressed)

Sets the pressed state for this view.

void

[setRenderEffect](/reference/android/view/View#setRenderEffect%28android.graphics.RenderEffect%29)([RenderEffect](/reference/android/graphics/RenderEffect) renderEffect)

Configure the [RenderEffect](/reference/android/graphics/RenderEffect) to apply to this View.

void

[setRequestedFrameRate](/reference/android/view/View#setRequestedFrameRate%28float%29)(float frameRate)

You can set the preferred frame rate for a View 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.

final void

[setRevealOnFocusHint](/reference/android/view/View#setRevealOnFocusHint%28boolean%29)(boolean revealOnFocus)

Sets this view's preference for reveal behavior when it gains focus.

final void

[setRight](/reference/android/view/View#setRight%28int%29)(int right)

Sets the right position of this view relative to its parent.

void

[setRotation](/reference/android/view/View#setRotation%28float%29)(float rotation)

Sets the degrees that the view is rotated around the pivot point.

void

[setRotationX](/reference/android/view/View#setRotationX%28float%29)(float rotationX)

Sets the degrees that the view is rotated around the horizontal axis through the pivot point.

void

[setRotationY](/reference/android/view/View#setRotationY%28float%29)(float rotationY)

Sets the degrees that the view is rotated around the vertical axis through the pivot point.

void

[setSaveEnabled](/reference/android/view/View#setSaveEnabled%28boolean%29)(boolean enabled)

Controls whether the saving of this view's state is enabled (that is, whether its [onSaveInstanceState()](/reference/android/view/View#onSaveInstanceState%28%29) method will be called).

void

[setSaveFromParentEnabled](/reference/android/view/View#setSaveFromParentEnabled%28boolean%29)(boolean enabled)

Controls whether the entire hierarchy under this view will save its state when a state saving traversal occurs from its parent.

void

[setScaleX](/reference/android/view/View#setScaleX%28float%29)(float scaleX)

Sets the amount that the view is scaled in x around the pivot point, as a proportion of the view's unscaled width.

void

[setScaleY](/reference/android/view/View#setScaleY%28float%29)(float scaleY)

Sets the amount that the view is scaled in Y around the pivot point, as a proportion of the view's unscaled width.

void

[setScreenReaderFocusable](/reference/android/view/View#setScreenReaderFocusable%28boolean%29)(boolean screenReaderFocusable)

Sets whether this View should be a focusable element for screen readers and include non-focusable Views from its subtree when providing feedback.

void

[setScrollBarDefaultDelayBeforeFade](/reference/android/view/View#setScrollBarDefaultDelayBeforeFade%28int%29)(int scrollBarDefaultDelayBeforeFade)

Define the delay before scrollbars fade.

void

[setScrollBarFadeDuration](/reference/android/view/View#setScrollBarFadeDuration%28int%29)(int scrollBarFadeDuration)

Define the scrollbar fade duration.

void

[setScrollBarSize](/reference/android/view/View#setScrollBarSize%28int%29)(int scrollBarSize)

Define the scrollbar size.

void

[setScrollBarStyle](/reference/android/view/View#setScrollBarStyle%28int%29)(int style)

Specify the style of the scrollbars.

final void

[setScrollCaptureCallback](/reference/android/view/View#setScrollCaptureCallback%28android.view.ScrollCaptureCallback%29)([ScrollCaptureCallback](/reference/android/view/ScrollCaptureCallback) callback)

Sets the callback to receive scroll capture requests.

void

[setScrollCaptureHint](/reference/android/view/View#setScrollCaptureHint%28int%29)(int hint)

Sets the scroll capture hint for this View.

void

[setScrollContainer](/reference/android/view/View#setScrollContainer%28boolean%29)(boolean isScrollContainer)

Change whether this view is one of the set of scrollable containers in its window.

void

[setScrollIndicators](/reference/android/view/View#setScrollIndicators%28int,%20int%29)(int indicators, int mask)

Sets the state of the scroll indicators specified by the mask.

void

[setScrollIndicators](/reference/android/view/View#setScrollIndicators%28int%29)(int indicators)

Sets the state of all scroll indicators.

void

[setScrollX](/reference/android/view/View#setScrollX%28int%29)(int value)

Set the horizontal scrolled position of your view.

void

[setScrollY](/reference/android/view/View#setScrollY%28int%29)(int value)

Set the vertical scrolled position of your view.

void

[setScrollbarFadingEnabled](/reference/android/view/View#setScrollbarFadingEnabled%28boolean%29)(boolean fadeScrollbars)

Define whether scrollbars will fade when the view is not scrolling.

void

[setSelected](/reference/android/view/View#setSelected%28boolean%29)(boolean selected)

Changes the selection state of this view.

void

[setSoundEffectsEnabled](/reference/android/view/View#setSoundEffectsEnabled%28boolean%29)(boolean soundEffectsEnabled)

Set whether this view should have sound effects enabled for events such as clicking and touching.

void

[setStateDescription](/reference/android/view/View#setStateDescription%28java.lang.CharSequence%29)([CharSequence](/reference/java/lang/CharSequence) stateDescription)

Sets the [View](/reference/android/view/View)'s state description.

void

[setStateListAnimator](/reference/android/view/View#setStateListAnimator%28android.animation.StateListAnimator%29)([StateListAnimator](/reference/android/animation/StateListAnimator) stateListAnimator)

Attaches the provided StateListAnimator to this View.

void

[setSupplementalDescription](/reference/android/view/View#setSupplementalDescription%28java.lang.CharSequence%29)([CharSequence](/reference/java/lang/CharSequence) supplementalDescription)

Sets the [View](/reference/android/view/View)'s supplemental description.

void

[setSystemGestureExclusionRects](/reference/android/view/View#setSystemGestureExclusionRects%28java.util.List<android.graphics.Rect>%29)([List](/reference/java/util/List)<[Rect](/reference/android/graphics/Rect)> rects)

Sets a list of areas within this view's post-layout coordinate space where the system should not intercept touch or other pointing device gestures.

void

[setSystemUiVisibility](/reference/android/view/View#setSystemUiVisibility%28int%29)(int visibility)

This method was deprecated in API level 30. SystemUiVisibility flags are deprecated. Use [WindowInsetsController](/reference/android/view/WindowInsetsController) instead.

void

[setTag](/reference/android/view/View#setTag%28int,%20java.lang.Object%29)(int key, [Object](/reference/java/lang/Object) tag)

Sets a tag associated with this view and a key.

void

[setTag](/reference/android/view/View#setTag%28java.lang.Object%29)([Object](/reference/java/lang/Object) tag)

Sets the tag associated with this view.

void

[setTextAlignment](/reference/android/view/View#setTextAlignment%28int%29)(int textAlignment)

Set the text alignment.

void

[setTextDirection](/reference/android/view/View#setTextDirection%28int%29)(int textDirection)

Set the text direction.

void

[setTooltipText](/reference/android/view/View#setTooltipText%28java.lang.CharSequence%29)([CharSequence](/reference/java/lang/CharSequence) tooltipText)

Sets the tooltip text which will be displayed in a small popup next to the view.

final void

[setTop](/reference/android/view/View#setTop%28int%29)(int top)

Sets the top position of this view relative to its parent.

void

[setTouchDelegate](/reference/android/view/View#setTouchDelegate%28android.view.TouchDelegate%29)([TouchDelegate](/reference/android/view/TouchDelegate) delegate)

Sets the TouchDelegate for this View.

void

[setTransitionAlpha](/reference/android/view/View#setTransitionAlpha%28float%29)(float alpha)

This property is intended only for use by the Fade transition, which animates it to produce a visual translucency that does not side-effect (or get affected by) the real alpha property.

final void

[setTransitionName](/reference/android/view/View#setTransitionName%28java.lang.String%29)([String](/reference/java/lang/String) transitionName)

Sets the name of the View to be used to identify Views in Transitions.

void

[setTransitionVisibility](/reference/android/view/View#setTransitionVisibility%28int%29)(int visibility)

Changes the visibility of this View without triggering any other changes.

void

[setTranslationX](/reference/android/view/View#setTranslationX%28float%29)(float translationX)

Sets the horizontal location of this view relative to its [left](/reference/android/view/View#getLeft%28%29) position.

void

[setTranslationY](/reference/android/view/View#setTranslationY%28float%29)(float translationY)

Sets the vertical location of this view relative to its [top](/reference/android/view/View#getTop%28%29) position.

void

[setTranslationZ](/reference/android/view/View#setTranslationZ%28float%29)(float translationZ)

Sets the depth location of this view relative to its [elevation](/reference/android/view/View#getElevation%28%29).

void

[setVerticalFadingEdgeEnabled](/reference/android/view/View#setVerticalFadingEdgeEnabled%28boolean%29)(boolean verticalFadingEdgeEnabled)

Define whether the vertical edges should be faded when this view is scrolled vertically.

void

[setVerticalScrollBarEnabled](/reference/android/view/View#setVerticalScrollBarEnabled%28boolean%29)(boolean verticalScrollBarEnabled)

Define whether the vertical scrollbar should be drawn or not.

void

[setVerticalScrollbarPosition](/reference/android/view/View#setVerticalScrollbarPosition%28int%29)(int position)

Set the position of the vertical scroll bar.

void

[setVerticalScrollbarThumbDrawable](/reference/android/view/View#setVerticalScrollbarThumbDrawable%28android.graphics.drawable.Drawable%29)([Drawable](/reference/android/graphics/drawable/Drawable) drawable)

Defines the vertical scrollbar thumb drawable

void

[setVerticalScrollbarTrackDrawable](/reference/android/view/View#setVerticalScrollbarTrackDrawable%28android.graphics.drawable.Drawable%29)([Drawable](/reference/android/graphics/drawable/Drawable) drawable)

Defines the vertical scrollbar track drawable

void

[setViewTranslationCallback](/reference/android/view/View#setViewTranslationCallback%28android.view.translation.ViewTranslationCallback%29)([ViewTranslationCallback](/reference/android/view/translation/ViewTranslationCallback) callback)

Sets a [ViewTranslationCallback](/reference/android/view/translation/ViewTranslationCallback) that is used to display/hide the translated information.

void

[setVisibility](/reference/android/view/View#setVisibility%28int%29)(int visibility)

Set the visibility state of this view.

void

[setWillNotCacheDrawing](/reference/android/view/View#setWillNotCacheDrawing%28boolean%29)(boolean willNotCacheDrawing)

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, [setLayerType(int,Paint)](/reference/android/view/View#setLayerType%28int,%20android.graphics.Paint%29) 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](/reference/android/graphics/Canvas) from either a [Bitmap](/reference/android/graphics/Bitmap) or[Picture](/reference/android/graphics/Picture) and call [draw(Canvas)](/reference/android/view/View#draw%28android.graphics.Canvas%29) on the View. However these software-rendered usages are discouraged and have compatibility issues with hardware-only rendering features such as [Config.HARDWARE](/reference/android/graphics/Bitmap.Config#HARDWARE) bitmaps, real-time shadows, and outline clipping. For screenshots of the UI for feedback reports or unit testing the [PixelCopy](/reference/android/view/PixelCopy) API is recommended.

void

[setWillNotDraw](/reference/android/view/View#setWillNotDraw%28boolean%29)(boolean willNotDraw)

If this view doesn't do any drawing on its own, set this flag to allow further optimizations.

void

[setWindowInsetsAnimationCallback](/reference/android/view/View#setWindowInsetsAnimationCallback%28android.view.WindowInsetsAnimation.Callback%29)([WindowInsetsAnimation.Callback](/reference/android/view/WindowInsetsAnimation.Callback) callback)

Sets a [WindowInsetsAnimation.Callback](/reference/android/view/WindowInsetsAnimation.Callback) to be notified about animations of windows that cause insets.

void

[setX](/reference/android/view/View#setX%28float%29)(float x)

Sets the visual x position of this view, in pixels.

void

[setY](/reference/android/view/View#setY%28float%29)(float y)

Sets the visual y position of this view, in pixels.

void

[setZ](/reference/android/view/View#setZ%28float%29)(float z)

Sets the visual z position of this view, in pixels.

boolean

[showContextMenu](/reference/android/view/View#showContextMenu%28%29)()

Shows the context menu for this view.

boolean

[showContextMenu](/reference/android/view/View#showContextMenu%28float,%20float%29)(float x, float y)

Shows the context menu for this view anchored to the specified view-relative coordinate.

[ActionMode](/reference/android/view/ActionMode)

[startActionMode](/reference/android/view/View#startActionMode%28android.view.ActionMode.Callback,%20int%29)([ActionMode.Callback](/reference/android/view/ActionMode.Callback) callback, int type)

Start an action mode with the given type.

[ActionMode](/reference/android/view/ActionMode)

[startActionMode](/reference/android/view/View#startActionMode%28android.view.ActionMode.Callback%29)([ActionMode.Callback](/reference/android/view/ActionMode.Callback) callback)

Start an action mode with the default type [ActionMode.TYPE_PRIMARY](/reference/android/view/ActionMode#TYPE%5FPRIMARY).

void

[startAnimation](/reference/android/view/View#startAnimation%28android.view.animation.Animation%29)([Animation](/reference/android/view/animation/Animation) animation)

Start the specified animation now.

final boolean

[startDrag](/reference/android/view/View#startDrag%28android.content.ClipData,%20android.view.View.DragShadowBuilder,%20java.lang.Object,%20int%29)([ClipData](/reference/android/content/ClipData) data, [View.DragShadowBuilder](/reference/android/view/View.DragShadowBuilder) shadowBuilder, [Object](/reference/java/lang/Object) myLocalState, int flags)

This method was deprecated in API level 24. Use [startDragAndDrop()](/reference/android/view/View#startDragAndDrop%28android.content.ClipData,%20android.view.View.DragShadowBuilder,%20java.lang.Object,%20int%29) for newer platform versions.

final boolean

[startDragAndDrop](/reference/android/view/View#startDragAndDrop%28android.content.ClipData,%20android.view.View.DragShadowBuilder,%20java.lang.Object,%20int%29)([ClipData](/reference/android/content/ClipData) data, [View.DragShadowBuilder](/reference/android/view/View.DragShadowBuilder) shadowBuilder, [Object](/reference/java/lang/Object) myLocalState, int flags)

Starts a drag and drop operation.

boolean

[startNestedScroll](/reference/android/view/View#startNestedScroll%28int%29)(int axes)

Begin a nestable scroll operation along the given axes.

void

[stopNestedScroll](/reference/android/view/View#stopNestedScroll%28%29)()

Stop a nested scroll in progress.

[String](/reference/java/lang/String)

[toString](/reference/android/view/View#toString%28%29)()

Returns a string representation of the object.

void

[transformMatrixToGlobal](/reference/android/view/View#transformMatrixToGlobal%28android.graphics.Matrix%29)([Matrix](/reference/android/graphics/Matrix) matrix)

Modifies the input matrix such that it maps view-local coordinates to on-screen coordinates.

void

[transformMatrixToLocal](/reference/android/view/View#transformMatrixToLocal%28android.graphics.Matrix%29)([Matrix](/reference/android/graphics/Matrix) matrix)

Modifies the input matrix such that it maps on-screen coordinates to view-local coordinates.

static void

[unregisterCalledFromWrongThreadListener](/reference/android/view/View#unregisterCalledFromWrongThreadListener%28android.view.View.CalledFromWrongThreadListener%29)([View.CalledFromWrongThreadListener](/reference/android/view/View.CalledFromWrongThreadListener) listener)

Unregisters a listener that was previously registered with[registerCalledFromWrongThreadListener(CalledFromWrongThreadListener)](/reference/android/view/View#registerCalledFromWrongThreadListener%28android.view.View.CalledFromWrongThreadListener%29).

void

[unscheduleDrawable](/reference/android/view/View#unscheduleDrawable%28android.graphics.drawable.Drawable,%20java.lang.Runnable%29)([Drawable](/reference/android/graphics/drawable/Drawable) who, [Runnable](/reference/java/lang/Runnable) what)

Cancels a scheduled action on a drawable.

void

[unscheduleDrawable](/reference/android/view/View#unscheduleDrawable%28android.graphics.drawable.Drawable%29)([Drawable](/reference/android/graphics/drawable/Drawable) who)

Unschedule any events associated with the given Drawable.

final void

[updateDragShadow](/reference/android/view/View#updateDragShadow%28android.view.View.DragShadowBuilder%29)([View.DragShadowBuilder](/reference/android/view/View.DragShadowBuilder) shadowBuilder)

Updates the drag shadow for the ongoing drag and drop operation.

boolean

[verifyDrawable](/reference/android/view/View#verifyDrawable%28android.graphics.drawable.Drawable%29)([Drawable](/reference/android/graphics/drawable/Drawable) who)

If your view subclass is displaying its own Drawable objects, it should override this function and return true for any Drawable it is displaying.

boolean

[willNotCacheDrawing](/reference/android/view/View#willNotCacheDrawing%28%29)()

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, [setLayerType(int,Paint)](/reference/android/view/View#setLayerType%28int,%20android.graphics.Paint%29) 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](/reference/android/graphics/Canvas) from either a [Bitmap](/reference/android/graphics/Bitmap) or[Picture](/reference/android/graphics/Picture) and call [draw(Canvas)](/reference/android/view/View#draw%28android.graphics.Canvas%29) on the View. However these software-rendered usages are discouraged and have compatibility issues with hardware-only rendering features such as [Config.HARDWARE](/reference/android/graphics/Bitmap.Config#HARDWARE) bitmaps, real-time shadows, and outline clipping. For screenshots of the UI for feedback reports or unit testing the [PixelCopy](/reference/android/view/PixelCopy) API is recommended.

boolean

[willNotDraw](/reference/android/view/View#willNotDraw%28%29)()

Returns whether or not this View draws on its own.