View Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
This class represents the basic building block for user interface components.
[Android.Runtime.Register("android/view/View", DoNotGenerateAcw=true)]
public class View : Java.Lang.Object, Android.Graphics.Drawables.Drawable.ICallback, Android.Views.Accessibility.IAccessibilityEventSource, Android.Views.KeyEvent.ICallback, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("android/view/View", DoNotGenerateAcw=true)>]
type View = class
inherit Object
interface Drawable.ICallback
interface IJavaObject
interface IDisposable
interface IJavaPeerable
interface IAccessibilityEventSource
interface KeyEvent.ICallback
- Inheritance
- Derived
- Attributes
- Implements
Remarks
This class represents the basic building block for user interface components. A View occupies a rectangular area on the screen and is responsible for drawing and event handling. View is the base class for <em>widgets</em>, which are used to create interactive UI components (buttons, text fields, etc.). The android.view.ViewGroup
subclass is the base class for <em>layouts</em>, which are invisible containers that hold other Views (or other ViewGroups) and define their layout properties.
<div class="special reference"> <h3>Developer Guides</h3>
For information about using this class to develop your application's user interface, read the User Interface developer guide. </div>
"Using"><h3>Using Views</h3>
All of the views in a window are arranged in a single tree. You can add views either from code or by specifying a tree of views in one or more XML layout files. There are many specialized subclasses of views that act as controls or are capable of displaying text, images, or other content.
Once you have created a tree of views, there are typically a few types of common operations you may wish to perform: <ul> <li><strong>Set properties:</strong> for example setting the text of a android.widget.TextView
. The available properties and the methods that set them will vary among the different subclasses of views. Note that properties that are known at build time can be set in the XML layout files.</li> <li><strong>Set focus:</strong> The framework will handle moving focus in response to user input. To force focus to a specific view, call #requestFocus
.</li> <li><strong>Set up listeners:</strong> Views allow clients to set listeners that will be notified when something interesting happens to the view. For example, all views will let you set a listener to be notified when the view gains or loses focus. You can register such a listener using #setOnFocusChangeListener(android.view.View.OnFocusChangeListener)
. Other view subclasses offer more specialized listeners. For example, a Button exposes a listener to notify clients when the button is clicked.</li> <li><strong>Set visibility:</strong> You can hide or show views using #setVisibility(int)
.</li> </ul>
<em> Note: The Android framework is responsible for measuring, laying out and drawing views. You should not call methods that perform these actions on views yourself unless you are actually implementing a android.view.ViewGroup
. </em>
"Lifecycle"><h3>Implementing a Custom View</h3>
To implement a custom view, you will usually begin by providing overrides for some of the standard methods that the framework calls on all views. You do not need to override all of these methods. In fact, you can start by just overriding #onDraw(android.graphics.Canvas)
. <table border="2" width="85%" align="center" cellpadding="5"> <thead> <tr><th>Category</th> <th>Methods</th> <th>Description</th></tr> </thead>
<tbody> <tr> <td rowspan="2">Creation</td> <td>Constructors</td> <td>There is a form of the constructor that are called when the view is created from code and a form that is called when the view is inflated from a layout file. The second form should parse and apply any attributes defined in the layout file. </td> </tr> <tr> <td>{@link #onFinishInflate()}
</td> <td>Called after a view and all of its children has been inflated from XML.</td> </tr>
<tr> <td rowspan="3">Layout</td> <td>{@link #onMeasure(int, int)}
</td> <td>Called to determine the size requirements for this view and all of its children. </td> </tr> <tr> <td>{@link #onLayout(boolean, int, int, int, int)}
</td> <td>Called when this view should assign a size and position to all of its children. </td> </tr> <tr> <td>{@link #onSizeChanged(int, int, int, int)}
</td> <td>Called when the size of this view has changed. </td> </tr>
<tr> <td>Drawing</td> <td>{@link #onDraw(android.graphics.Canvas)}
</td> <td>Called when the view should render its content. </td> </tr>
<tr> <td rowspan="6">Event processing</td> <td>{@link #onKeyDown(int, KeyEvent)}
</td> <td>Called when a new hardware key event occurs. </td> </tr> <tr> <td>{@link #onKeyUp(int, KeyEvent)}
</td> <td>Called when a hardware key up event occurs. </td> </tr> <tr> <td>{@link #onTrackballEvent(MotionEvent)}
</td> <td>Called when a trackball motion event occurs. </td> </tr> <tr> <td>{@link #onTouchEvent(MotionEvent)}
</td> <td>Called when a touch screen motion event occurs. </td> </tr> <tr> <td>{@link #onGenericMotionEvent(MotionEvent)}
</td> <td>Called when a generic motion event occurs. </td> </tr> <tr> <td>{@link #onHoverEvent(MotionEvent)}
</td> <td>Called when a hover motion event occurs. </td> </tr>
<tr> <td rowspan="2">Focus</td> <td>{@link #onFocusChanged(boolean, int, android.graphics.Rect)}
</td> <td>Called when the view gains or loses focus. </td> </tr>
<tr> <td>{@link #onWindowFocusChanged(boolean)}
</td> <td>Called when the window containing the view gains or loses focus. </td> </tr>
<tr> <td rowspan="3">Attaching</td> <td>{@link #onAttachedToWindow()}
</td> <td>Called when the view is attached to a window. </td> </tr>
<tr> <td>{@link #onDetachedFromWindow}
</td> <td>Called when the view is detached from its window. </td> </tr>
<tr> <td>{@link #onWindowVisibilityChanged(int)}
</td> <td>Called when the visibility of the window containing the view has changed. </td> </tr> </tbody>
</table>
"IDs"><h3>IDs</h3> Views may have an integer id associated with them. These ids are typically assigned in the layout XML files, and are used to find specific views within the view tree. A common pattern is to: <ul> <li>Define a Button in the layout file and assign it a unique ID.
<Button
android:id="@+id/my_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/my_button_text"/>
</li> <li>From the onCreate method of an Activity, find the Button
Button myButton = findViewById(R.id.my_button);
</li> </ul>
View IDs need not be unique throughout the tree, but it is good practice to ensure that they are at least unique within the part of the tree you are searching.
"Position"><h3>Position</h3>
The geometry of a view is that of a rectangle. A view has a location, expressed as a pair of <em>left</em> and <em>top</em> coordinates, and two dimensions, expressed as a width and a height. The unit for location and dimensions is the pixel.
It is possible to retrieve the location of a view by invoking the methods #getLeft()
and #getTop()
. The former returns the left, or X, coordinate of the rectangle representing the view. The latter returns the top, or Y, coordinate of the rectangle representing the view. These methods both return the location of the view relative to its parent. For instance, when getLeft() returns 20, that means the view is located 20 pixels to the right of the left edge of its direct parent.
In addition, several convenience methods are offered to avoid unnecessary computations, namely #getRight()
and #getBottom()
. These methods return the coordinates of the right and bottom edges of the rectangle representing the view. For instance, calling #getRight()
is similar to the following computation: getLeft() + getWidth()
(see Size for more information about the width.)
"SizePaddingMargins"><h3>Size, padding and margins</h3>
The size of a view is expressed with a width and a height. A view actually possess two pairs of width and height values.
The first pair is known as <em>measured width</em> and <em>measured height</em>. These dimensions define how big a view wants to be within its parent (see Layout for more details.) The measured dimensions can be obtained by calling #getMeasuredWidth()
and #getMeasuredHeight()
.
The second pair is simply known as <em>width</em> and <em>height</em>, or sometimes <em>drawing width</em> and <em>drawing height</em>. These dimensions define the actual size of the view on screen, at drawing time and after layout. These values may, but do not have to, be different from the measured width and height. The width and height can be obtained by calling #getWidth()
and #getHeight()
.
To measure its dimensions, a view takes into account its padding. The padding is expressed in pixels for the left, top, right and bottom parts of the view. Padding can be used to offset the content of the view by a specific amount of pixels. For instance, a left padding of 2 will push the view's content by 2 pixels to the right of the left edge. Padding can be set using the #setPadding(int, int, int, int)
or #setPaddingRelative(int, int, int, int)
method and queried by calling #getPaddingLeft()
, #getPaddingTop()
, #getPaddingRight()
, #getPaddingBottom()
, #getPaddingStart()
, #getPaddingEnd()
.
Even though a view can define a padding, it does not provide any support for margins. However, view groups provide such a support. Refer to android.view.ViewGroup
and android.view.ViewGroup.MarginLayoutParams
for further information.
"Layout"><h3>Layout</h3>
Layout is a two pass process: a measure pass and a layout pass. The measuring pass is implemented in #measure(int, int)
and is a top-down traversal of the view tree. Each view pushes dimension specifications down the tree during the recursion. At the end of the measure pass, every view has stored its measurements. The second pass happens in #layout(int,int,int,int)
and is also top-down. During this pass each parent is responsible for positioning all of its children using the sizes computed in the measure pass.
When a view's measure() method returns, its #getMeasuredWidth()
and #getMeasuredHeight()
values must be set, along with those for all of that view's descendants. A view's measured width and measured height values must respect the constraints imposed by the view's parents. This guarantees that at the end of the measure pass, all parents accept all of their children's measurements. A parent view may call measure() more than once on its children. For example, the parent may measure each child once with unspecified dimensions to find out how big they want to be, then call measure() on them again with actual numbers if the sum of all the children's unconstrained sizes is too big or too small.
The measure pass uses two classes to communicate dimensions. The MeasureSpec
class is used by views to tell their parents how they want to be measured and positioned. The base LayoutParams class just describes how big the view wants to be for both width and height. For each dimension, it can specify one of: <ul> <li> an exact number <li>MATCH_PARENT, which means the view wants to be as big as its parent (minus padding) <li> WRAP_CONTENT, which means that the view wants to be just big enough to enclose its content (plus padding). </ul> There are subclasses of LayoutParams for different subclasses of ViewGroup. For example, AbsoluteLayout has its own subclass of LayoutParams which adds an X and Y value.
MeasureSpecs are used to push requirements down the tree from parent to child. A MeasureSpec can be in one of three modes: <ul> <li>UNSPECIFIED: This is used by a parent to determine the desired dimension of a child view. For example, a LinearLayout may call measure() on its child with the height set to UNSPECIFIED and a width of EXACTLY 240 to find out how tall the child view wants to be given a width of 240 pixels. <li>EXACTLY: This is used by the parent to impose an exact size on the child. The child must use this size, and guarantee that all of its descendants will fit within this size. <li>AT_MOST: This is used by the parent to impose a maximum size on the child. The child must guarantee that it and all of its descendants will fit within this size. </ul>
To initiate a layout, call #requestLayout
. This method is typically called by a view on itself when it believes that it can no longer fit within its current bounds.
"Drawing"><h3>Drawing</h3>
Drawing is handled by walking the tree and recording the drawing commands of any View that needs to update. After this, the drawing commands of the entire tree are issued to screen, clipped to the newly damaged area.
The tree is largely recorded and drawn in order, with parents drawn before (i.e., behind) their children, with siblings drawn in the order they appear in the tree. If you set a background drawable for a View, then the View will draw it before calling back to its onDraw()
method. The child drawing order can be overridden with ViewGroup#setChildrenDrawingOrderEnabled(boolean) custom child drawing order
in a ViewGroup, and with #setZ(float)
custom Z values} set on Views.
To force a view to draw, call #invalidate()
.
"EventHandlingThreading"><h3>Event Handling and Threading</h3>
The basic cycle of a view is as follows: <ol> <li>An event comes in and is dispatched to the appropriate view. The view handles the event and notifies any listeners.</li> <li>If in the course of processing the event, the view's bounds may need to be changed, the view will call #requestLayout()
.</li> <li>Similarly, if in the course of processing the event the view's appearance may need to be changed, the view will call #invalidate()
.</li> <li>If either #requestLayout()
or #invalidate()
were called, the framework will take care of measuring, laying out, and drawing the tree as appropriate.</li> </ol>
<em>Note: The entire view tree is single threaded. You must always be on the UI thread when calling any method on any view.</em> If you are doing work on other threads and want to update the state of a view from that thread, you should use a Handler
.
"FocusHandling"><h3>Focus Handling</h3>
The framework will handle routine focus movement in response to user input. This includes changing the focus as views are removed or hidden, or as new views become available. Views indicate their willingness to take focus through the #isFocusable
method. To change whether a view can take focus, call #setFocusable(boolean)
. When in touch mode (see notes below) views indicate whether they still would like focus via #isFocusableInTouchMode
and can change this via #setFocusableInTouchMode(boolean)
.
Focus movement is based on an algorithm which finds the nearest neighbor in a given direction. In rare cases, the default algorithm may not match the intended behavior of the developer. In these situations, you can provide explicit overrides by using these XML attributes in the layout file:
nextFocusDown
nextFocusLeft
nextFocusRight
nextFocusUp
</p>
To get a particular view to take focus, call #requestFocus()
.
"TouchMode"><h3>Touch Mode</h3>
When a user is navigating a user interface via directional keys such as a D-pad, it is necessary to give focus to actionable items such as buttons so the user can see what will take input. If the device has touch capabilities, however, and the user begins interacting with the interface by touching it, it is no longer necessary to always highlight, or give focus to, a particular view. This motivates a mode for interaction named 'touch mode'.
For a touch capable device, once the user touches the screen, the device will enter touch mode. From this point onward, only views for which #isFocusableInTouchMode
is true will be focusable, such as text editing widgets. Other views that are touchable, like buttons, will not take focus when touched; they will only fire the on click listeners.
Any time a user hits a directional key, such as a D-pad direction, the view device will exit touch mode, and find a view to take focus, so that the user may resume interacting with the user interface without touching the screen again.
The touch mode state is maintained across android.app.Activity
s. Call #isInTouchMode
to see whether the device is currently in touch mode.
"Scrolling"><h3>Scrolling</h3>
The framework provides basic support for views that wish to internally scroll their content. This includes keeping track of the X and Y scroll offset as well as mechanisms for drawing scrollbars. See #scrollBy(int, int)
, #scrollTo(int, int)
, and #awakenScrollBars()
for more details.
"Tags"><h3>Tags</h3>
Unlike IDs, tags are not used to identify views. Tags are essentially an extra piece of information that can be associated with a view. They are most often used as a convenience to store data related to views in the views themselves rather than by putting them in a separate structure.
Tags may be specified with character sequence values in layout XML as either a single tag using the android.R.styleable#View_tag android:tag
attribute or multiple tags using the <tag>
child element:
<View ...
android:tag="@string/mytag_value" />
<View ...>
<tag android:id="@+id/mytag"
android:value="@string/mytag_value" />
</View>
</p>
Tags may also be specified with arbitrary objects from code using #setTag(Object)
or #setTag(int, Object)
.
"Themes"><h3>Themes</h3>
By default, Views are created using the theme of the Context object supplied to their constructor; however, a different theme may be specified by using the android.R.styleable#View_theme android:theme
attribute in layout XML or by passing a ContextThemeWrapper
to the constructor from code.
When the android.R.styleable#View_theme android:theme
attribute is used in XML, the specified theme is applied on top of the inflation context's theme (see LayoutInflater
) and used for the view itself as well as any child elements.
In the following example, both views will be created using the Material dark color scheme; however, because an overlay theme is used which only defines a subset of attributes, the value of android.R.styleable#Theme_colorAccent android:colorAccent
defined on the inflation context's theme (e.g. the Activity theme) will be preserved.
<LinearLayout
...
android:theme="@android:theme/ThemeOverlay.Material.Dark">
<View ...>
</LinearLayout>
</p>
"Properties"><h3>Properties</h3>
The View class exposes an #ALPHA
property, as well as several transform-related properties, such as #TRANSLATION_X
and #TRANSLATION_Y
. These properties are available both in the Property
form as well as in similarly-named setter/getter methods (such as #setAlpha(float)
for #ALPHA
). These properties can be used to set persistent state associated with these rendering-related properties on the view. The properties and methods can also be used in conjunction with android.animation.Animator Animator
-based animations, described more in the Animation section.
"Animation"><h3>Animation</h3>
Starting with Android 3.0, the preferred way of animating views is to use the android.animation
package APIs. These android.animation.Animator Animator
-based classes change actual properties of the View object, such as #setAlpha(float) alpha
and #setTranslationX(float) translationX
. This behavior is contrasted to that of the pre-3.0 android.view.animation.Animation Animation
-based classes, which instead animate only how the view is drawn on the display. In particular, the ViewPropertyAnimator
class makes animating these View properties particularly easy and efficient.
Alternatively, you can use the pre-3.0 animation classes to animate how Views are rendered. You can attach an Animation
object to a view using #setAnimation(Animation)
or #startAnimation(Animation)
. The animation can alter the scale, rotation, translation and alpha of a view over time. If the animation is attached to a view that has children, the animation will affect the entire subtree rooted by that node. When an animation is started, the framework will take care of redrawing the appropriate views until the animation completes.
"Security"><h3>Security</h3>
Sometimes it is essential that an application be able to verify that an action is being performed with the full knowledge and consent of the user, such as granting a permission request, making a purchase or clicking on an advertisement. Unfortunately, a malicious application could try to spoof the user into performing these actions, unaware, by concealing the intended purpose of the view. As a remedy, the framework offers a touch filtering mechanism that can be used to improve the security of views that provide access to sensitive functionality.
To enable touch filtering, call #setFilterTouchesWhenObscured(boolean)
or set the android:filterTouchesWhenObscured layout attribute to true. When enabled, the framework will discard touches that are received whenever the view's window is obscured by another visible window at the touched location. As a result, the view will not receive touches whenever the touch passed through a toast, dialog or other window that appears above the view's window.
For more fine-grained control over security, consider overriding the #onFilterTouchEventForSecurity(MotionEvent)
method to implement your own security policy. See also MotionEvent#FLAG_WINDOW_IS_OBSCURED
.
Java documentation for android.view.View
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Constructors
View(Context) |
Simple constructor to use when creating a view from code. |
View(Context, IAttributeSet) |
Constructor that is called when inflating a view from XML. |
View(Context, IAttributeSet, Int32) |
Perform inflation from XML and apply a class-specific base style from a theme attribute. |
View(Context, IAttributeSet, Int32, Int32) |
Perform inflation from XML and apply a class-specific base style from a theme attribute or style resource. |
View(IntPtr, JniHandleOwnership) |
A constructor used when creating managed representations of JNI objects; called by the runtime. |
Fields
AccessibilityDataSensitiveAuto |
Obsolete.
Automatically determine whether the view should only allow interactions from
|
AccessibilityDataSensitiveNo |
Obsolete.
Allow interactions from all |
AccessibilityDataSensitiveYes |
Obsolete.
Only allow interactions from |
AccessibilityLiveRegionAssertive |
Obsolete.
Live region mode specifying that accessibility services should interrupt ongoing speech to immediately announce changes to this view. |
AccessibilityLiveRegionNone |
Obsolete.
Live region mode specifying that accessibility services should not automatically announce changes to this view. |
AccessibilityLiveRegionPolite |
Obsolete.
Live region mode specifying that accessibility services should announce changes to this view. |
AutofillFlagIncludeNotImportantViews |
Obsolete.
Flag requesting you to add views that are marked as not important for autofill
(see |
AutofillHintCreditCardExpirationDate |
Hint indicating that this view can be autofilled with a credit card expiration date. |
AutofillHintCreditCardExpirationDay |
Hint indicating that this view can be autofilled with a credit card expiration day. |
AutofillHintCreditCardExpirationMonth |
Hint indicating that this view can be autofilled with a credit card expiration month. |
AutofillHintCreditCardExpirationYear |
Hint indicating that this view can be autofilled with a credit card expiration year. |
AutofillHintCreditCardNumber |
Hint indicating that this view can be autofilled with a credit card number. |
AutofillHintCreditCardSecurityCode |
Hint indicating that this view can be autofilled with a credit card security code. |
AutofillHintEmailAddress |
Hint indicating that this view can be autofilled with an email address. |
AutofillHintName |
Hint indicating that this view can be autofilled with a user's real name. |
AutofillHintPassword |
Hint indicating that this view can be autofilled with a password. |
AutofillHintPhone |
Hint indicating that this view can be autofilled with a phone number. |
AutofillHintPostalAddress |
Hint indicating that this view can be autofilled with a postal address. |
AutofillHintPostalCode |
Hint indicating that this view can be autofilled with a postal code. |
AutofillHintUsername |
Hint indicating that this view can be autofilled with a username. |
AutofillTypeDate |
Obsolete.
Autofill type for a field that contains a date, which is represented by a long representing
the number of milliseconds since the standard base time known as "the epoch", namely
January 1, 1970, 00:00:00 GMT (see |
AutofillTypeList |
Obsolete.
Autofill type for a selection list field, which is filled by an |
AutofillTypeNone |
Obsolete.
Autofill type for views that cannot be autofilled. |
AutofillTypeText |
Obsolete.
Autofill type for a text field, which is filled by a |
AutofillTypeToggle |
Obsolete.
Autofill type for a togglable field, which is filled by a |
DragFlagAccessibilityAction |
Obsolete.
Flag indicating that the drag was initiated with
|
DragFlagGlobal |
Obsolete.
Flag indicating that a drag can cross window boundaries. |
DragFlagGlobalPersistableUriPermission |
Obsolete.
When this flag is used with |
DragFlagGlobalPrefixUriPermission |
Obsolete.
When this flag is used with |
DragFlagGlobalUriRead |
Obsolete.
When this flag is used with |
DragFlagGlobalUriWrite |
Obsolete.
When this flag is used with |
DragFlagOpaque |
Obsolete.
Flag indicating that the drag shadow will be opaque. |
FindViewsWithContentDescription |
Obsolete.
Find find views that contain the specified content description. |
FocusableAuto |
Obsolete.
This view determines focusability automatically. |
ImportantForAccessibilityAuto |
Obsolete.
Automatically determine whether a view is important for accessibility. |
ImportantForAccessibilityNo |
Obsolete.
The view is not important for accessibility. |
ImportantForAccessibilityNoHideDescendants |
Obsolete.
The view is not important for accessibility, nor are any of its descendant views. |
ImportantForAccessibilityYes |
Obsolete.
The view is important for accessibility. |
ImportantForAutofillAuto |
Obsolete.
Automatically determine whether a view is important for autofill. |
ImportantForAutofillNo |
Obsolete.
The view is not important for autofill, but its children (if any) will be traversed. |
ImportantForAutofillNoExcludeDescendants |
Obsolete.
The view is not important for autofill, and its children (if any) will not be traversed. |
ImportantForAutofillYes |
Obsolete.
The view is important for autofill, and its children (if any) will be traversed. |
ImportantForAutofillYesExcludeDescendants |
Obsolete.
The view is important for autofill, but its children (if any) will not be traversed. |
ImportantForContentCaptureAuto |
Obsolete.
Automatically determine whether a view is important for content capture. |
ImportantForContentCaptureNo |
Obsolete.
The view is not important for content capture, but its children (if any) will be traversed. |
ImportantForContentCaptureNoExcludeDescendants |
Obsolete.
The view is not important for content capture, and its children (if any) will not be traversed. |
ImportantForContentCaptureYes |
Obsolete.
The view is important for content capture, and its children (if any) will be traversed. |
ImportantForContentCaptureYesExcludeDescendants |
Obsolete.
The view is important for content capture, but its children (if any) will not be traversed. |
LayoutDirectionInherit |
Obsolete.
Horizontal layout direction of this view is inherited from its parent. |
LayoutDirectionLocale |
Obsolete.
Horizontal layout direction of this view is from deduced from the default language script for the locale. |
LayoutDirectionLtr |
Obsolete.
Horizontal layout direction of this view is from Left to Right. |
LayoutDirectionRtl |
Obsolete.
Horizontal layout direction of this view is from Right to Left. |
MeasuredHeightStateShift |
Bit shift of |
MeasuredSizeMask |
Bits of |
MeasuredStateMask |
Bits of |
MeasuredStateTooSmall |
Bit of |
NoId |
Used to mark a View that has no ID. |
NotFocusable |
Obsolete.
This view does not want keystrokes. |
OverScrollAlways |
Obsolete.
Always allow a user to over-scroll this view, provided it is a view that can scroll. |
OverScrollIfContentScrolls |
Obsolete.
Allow a user to over-scroll this view only if the content is large enough to meaningfully scroll, provided it is a view that can scroll. |
OverScrollNever |
Obsolete.
Never allow a user to over-scroll this view. |
ScreenStateOff |
Obsolete.
Indicates that the screen has changed state and is now off. |
ScreenStateOn |
Obsolete.
Indicates that the screen has changed state and is now on. |
ScrollAxisHorizontal |
Obsolete.
Indicates scrolling along the horizontal axis. |
ScrollAxisNone |
Obsolete.
Indicates no axis of view scrolling. |
ScrollAxisVertical |
Obsolete.
Indicates scrolling along the vertical axis. |
ScrollCaptureHintAuto |
Obsolete.
The content of this view will be considered for scroll capture if scrolling is possible. |
ScrollCaptureHintExclude |
Obsolete.
Explicitly exclude this view as a potential scroll capture target. |
ScrollCaptureHintExcludeDescendants |
Obsolete.
Explicitly exclude all children of this view as potential scroll capture targets. |
ScrollCaptureHintInclude |
Obsolete.
Explicitly include this view as a potential scroll capture target. |
SystemUiFlagFullscreen |
Flag for |
SystemUiFlagHideNavigation |
Flag for |
SystemUiFlagImmersive |
Flag for |
SystemUiFlagImmersiveSticky |
Flag for |
SystemUiFlagLayoutFullscreen |
Flag for |
SystemUiFlagLayoutHideNavigation |
Flag for |
SystemUiFlagLayoutStable |
Flag for |
SystemUiFlagLightNavigationBar |
Flag for |
SystemUiFlagLightStatusBar |
Flag for |
SystemUiFlagLowProfile |
Flag for |
SystemUiFlagVisible |
Special constant for |
SystemUiLayoutFlags |
Flags that can impact the layout in relation to system UI. |
TextAlignmentCenter |
Obsolete.
Center the paragraph, e. |
TextAlignmentGravity |
Obsolete.
Default for the root view. |
TextAlignmentInherit |
Obsolete.
Default text alignment. |
TextAlignmentResolvedDefault |
Obsolete.
Default resolved text alignment |
TextAlignmentTextEnd |
Obsolete.
Align to the end of the paragraph, e. |
TextAlignmentTextStart |
Obsolete.
Align to the start of the paragraph, e. |
TextAlignmentViewEnd |
Obsolete.
Align to the end of the view, which is ALIGN_RIGHT if the view's resolved layoutDirection is LTR, and ALIGN_LEFT otherwise. |
TextAlignmentViewStart |
Obsolete.
Align to the start of the view, which is ALIGN_LEFT if the view's resolved layoutDirection is LTR, and ALIGN_RIGHT otherwise. |
TextDirectionAnyRtl |
Obsolete.
Text direction is using "any-RTL" algorithm. |
TextDirectionFirstStrong |
Obsolete.
Text direction is using "first strong algorithm". |
TextDirectionFirstStrongLtr |
Obsolete.
Text direction is using "first strong algorithm". |
TextDirectionFirstStrongRtl |
Obsolete.
Text direction is using "first strong algorithm". |
TextDirectionInherit |
Obsolete.
Text direction is inherited through |
TextDirectionLocale |
Obsolete.
Text direction is coming from the system Locale. |
TextDirectionLtr |
Obsolete.
Text direction is forced to LTR. |
TextDirectionRtl |
Obsolete.
Text direction is forced to RTL. |
ViewLogTag |
The logging tag used by this class with android. |
Properties
AccessibilityClassName | |
AccessibilityClassNameFormatted |
Return the class name of this object to be used for accessibility purposes. |
AccessibilityHeading |
Gets whether this view is a heading for accessibility purposes. -or- Set if view is a heading for a section of content for accessibility purposes. |
AccessibilityLiveRegion |
Gets the live region mode for this View. -or- Sets the live region mode for this view. |
AccessibilityNodeProvider |
Gets the provider for managing a virtual view hierarchy rooted at this View
and reported to |
AccessibilityPaneTitle | |
AccessibilityPaneTitleFormatted |
Get the title of the pane for purposes of accessibility. -or- Visually distinct portion of a window with window-like semantics are considered panes for accessibility purposes. |
AccessibilityTraversalAfter |
Gets the id of a view after which this one is visited in accessibility traversal. -or- Sets the id of a view after which this one is visited in accessibility traversal. |
AccessibilityTraversalBefore |
Gets the id of a view before which this one is visited in accessibility traversal. -or- Sets the id of a view before which this one is visited in accessibility traversal. |
Activated |
Indicates the activation state of this view. -or- Changes the activated state of this view. |
AllowedHandwritingDelegatePackageName |
Returns the allowed package for delegate editor views for which this view may act as a
handwriting delegator, as set by |
AllowedHandwritingDelegatorPackageName |
Returns the allowed package for views which may act as a handwriting delegator for this
delegate editor view, as set by |
Alpha |
The opacity of the view. -or- 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. |
Animation |
Get the animation currently associated with this view. -or- Sets the next animation to play for this view. |
AnimationMatrix |
Return the current transformation matrix of the view. -or- Changes the transformation matrix on the view. |
ApplicationWindowToken |
Retrieve a unique token identifying the top-level "real" window of the window that this view is attached to. |
ApplyWindowInsets | |
AttributeSourceResourceMap |
Returns the mapping of attribute resource ID to source resource ID where the attribute value was set. |
AutofillId |
Gets the unique, logical identifier of this view in the activity, for autofill purposes. -or- Sets the unique, logical identifier of this view in the activity, for autofill purposes. |
AutofillType |
Describes the autofill type of this view, so an
|
AutofillValue |
Gets the |
AutoHandwritingEnabled |
Return whether the View allows automatic handwriting initiation. -or- Set whether this view enables automatic handwriting initiation. |
Background |
Gets the background drawable -or- Set the background to a given Drawable, or remove the background. |
BackgroundTintBlendMode |
Return the blending mode used to apply the tint to the background
drawable, if specified. -or- Specifies the blending mode used to apply the tint specified by
|
BackgroundTintList |
Return the tint applied to the background drawable, if specified. -or- Applies a tint to the background drawable. |
BackgroundTintMode |
Return the blending mode used to apply the tint to the background drawable, if specified. |
Baseline |
Return the offset of the widget's text baseline from the widget's top boundary. |
Bottom |
Bottom position of this view relative to its parent. -or- Sets the bottom position of this view relative to its parent. |
BottomFadingEdgeStrength |
Returns the strength, or intensity, of the bottom faded edge. |
BottomPaddingOffset |
Amount by which to extend the bottom fading region. |
CameraDistance |
Gets the distance along the Z axis from the camera to this view. |
Class |
Returns the runtime class of this |
Clickable |
Indicates whether this view reacts to click events or not. -or- Enables or disables click events for this view. |
ClipBounds |
Returns a copy of the current |
ClipToOutline |
Returns whether the Outline should be used to clip the contents of the View. -or- Sets whether the View's Outline should be used to clip the contents of the View. |
ContentCaptureSession |
Gets the session used to notify content capture events. -or- Sets the (optional) |
ContentDescription | |
ContentDescriptionFormatted |
Returns the |
Context |
Returns the context the view is running in, through which it can access the current theme, resources, etc. |
ContextClickable |
Indicates whether this view reacts to context clicks or not. -or- Enables or disables context clicking for this view. |
ContextMenuInfo |
Views should implement this if they have extra information to associate with the context menu. |
DefaultFocusHighlightEnabled |
Returns whether this View should use a default focus highlight when it gets focused but
doesn't have |
Display |
Gets the logical display to which the view's window has been attached. |
DrawingCache |
Calling this method is equivalent to calling |
DrawingCacheBackgroundColor |
This member is deprecated. -or- Setting a solid background color for the drawing cache's bitmaps will improve performance and memory usage. |
DrawingCacheEnabled |
Indicates whether the drawing cache is enabled for this view. -or- Enables or disables the drawing cache. |
DrawingCacheQuality |
Returns the quality of the drawing cache. -or- Set the drawing cache quality of this view. |
DrawingTime |
Return the time at which the drawing of the view hierarchy started. |
DuplicateParentStateEnabled |
Indicates whether this duplicates its drawable state from its parent. -or- Enables or disables the duplication of the parent's state into this view. |
Elevation |
The base elevation of this view relative to its parent, in pixels. -or- Sets the base elevation of this view, in pixels. |
EmptyStateSet |
Indicates the view has no states set. |
Enabled |
Returns the enabled status for this view. -or- Set the enabled state of this view. |
EnabledFocusedSelectedStateSet |
Indicates the view is enabled, focused and selected. |
EnabledFocusedSelectedWindowFocusedStateSet |
Indicates the view is enabled, focused, selected and its window has the focus. |
EnabledFocusedStateSet |
Indicates the view is enabled and has the focus. |
EnabledFocusedWindowFocusedStateSet |
Indicates the view is enabled, focused and its window has the focus. |
EnabledSelectedStateSet |
Indicates the view is enabled and selected. |
EnabledSelectedWindowFocusedStateSet |
Indicates the view is enabled, selected and its window has the focus. |
EnabledStateSet |
Indicates the view is enabled. |
EnabledWindowFocusedStateSet |
Indicates the view is enabled and that its window has focus. |
ExplicitStyle |
Returns the resource ID for the style specified using |
FilterTouchesWhenObscured |
Gets whether the framework should discard touches when the view's window is obscured by another visible window at the touched location. -or- Sets whether the framework should discard touches when the view's window is obscured by another visible window at the touched location. |
FitsSystemWindows |
Check for state of |
Focusable |
Returns whether this View is currently able to take focus. -or- Set whether this view can receive the focus. |
FocusableInTouchMode |
When a view is focusable, it may not want to take focus when in touch mode. -or- Set whether this view can receive focus while in touch mode. |
FocusedByDefault |
Returns whether this View should receive focus when the focus is restored for the view hierarchy containing this view. -or- Sets whether this View should receive focus when the focus is restored for the view hierarchy containing this view. |
FocusedSelectedStateSet |
Indicates the view is focused and selected. |
FocusedSelectedWindowFocusedStateSet |
Indicates the view is focused, selected and its window has the focus. |
FocusedStateSet |
Indicates the view is focused. |
FocusedWindowFocusedStateSet |
Indicates the view has the focus and that its window has the focus. |
ForceDarkAllowed |
See |
Foreground |
Returns the drawable used as the foreground of this View. -or- Supply a Drawable that is to be rendered on top of all of the content in the view. |
ForegroundGravity |
Describes how the foreground is positioned. |
ForegroundTintBlendMode |
Return the blending mode used to apply the tint to the foreground
drawable, if specified. -or- Specifies the blending mode used to apply the tint specified by
|
ForegroundTintList |
Return the tint applied to the foreground drawable, if specified. -or- Applies a tint to the foreground drawable. |
ForegroundTintMode |
Return the blending mode used to apply the tint to the foreground drawable, if specified. |
Handle |
The handle to the underlying Android instance. (Inherited from Object) |
Handler | |
HandwritingBoundsOffsetBottom |
Return the amount of offset applied to the bottom edge of this view's handwriting bounds, in the unit of pixel. |
HandwritingBoundsOffsetLeft |
Return the amount of offset applied to the left edge of this view's handwriting bounds, in the unit of pixel. |
HandwritingBoundsOffsetRight |
Return the amount of offset applied to the right edge of this view's handwriting bounds, in the unit of pixel. |
HandwritingBoundsOffsetTop |
Return the amount of offset applied to the top edge of this view's handwriting bounds, in the unit of pixel. |
HandwritingDelegatorCallback |
Returns the callback set by |
HapticFeedbackEnabled |
Set whether this view should have haptic feedback for events such as long presses. |
HasExplicitFocusable |
Returns true if this view is focusable or if it contains a reachable View
for which |
HasFocus |
Returns true if this view has focus itself, or is the ancestor of the view that has focus. |
HasFocusable |
Returns true if this view is focusable or if it contains a reachable View
for which |
HasNestedScrollingParent |
Returns true if this view has a nested scrolling parent. |
HasOnClickListeners |
Return whether this view has an attached OnClickListener. |
HasOnLongClickListeners |
Return whether this view has an attached OnLongClickListener. |
HasOverlappingRendering |
Returns whether this View has content which overlaps. |
HasPointerCapture |
Checks pointer capture status. |
HasTransientState |
Indicates whether the view is currently tracking transient state that the app should not need to concern itself with saving and restoring, but that the framework should take special note to preserve when possible. -or- Set whether this view is currently tracking transient state that the framework should attempt to preserve when possible. |
HasWindowFocus |
Returns true if this view is in a window that currently has window focus. |
Height |
Return the height of your view. |
HorizontalFadingEdgeEnabled |
Indicate whether the horizontal edges are faded when the view is scrolled horizontally. -or- Define whether the horizontal edges should be faded when this view is scrolled horizontally. |
HorizontalFadingEdgeLength |
Returns the size of the horizontal faded edges used to indicate that more content in this view is visible. |
HorizontalScrollBarEnabled |
Indicate whether the horizontal scrollbar should be drawn or not. -or- Define whether the horizontal scrollbar should be drawn or not. |
HorizontalScrollbarHeight |
Returns the height of the horizontal scrollbar. |
HorizontalScrollbarThumbDrawable |
Returns the currently configured Drawable for the thumb of the horizontal scroll bar if it exists, null otherwise. -or- Defines the horizontal thumb drawable |
HorizontalScrollbarTrackDrawable |
Returns the currently configured Drawable for the track of the horizontal scroll bar if it exists, null otherwise. -or- Defines the horizontal track drawable |
Hovered |
Returns true if the view is currently hovered. -or- Sets whether the view is currently hovered. |
Id |
Returns this view's identifier. -or- Sets the identifier for this view. |
ImportantForAccessibility |
Gets the mode for determining whether this View is important for accessibility. -or- 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. |
ImportantForAutofill |
Gets the mode for determining whether this view is important for autofill. -or- Sets the mode for determining whether this view is considered important for autofill. |
ImportantForContentCapture |
Gets the mode for determining whether this view is important for content capture. -or- Sets the mode for determining whether this view is considered important for content capture. |
IsAccessibilityDataSensitive |
Whether this view should restrict accessibility service access only to services that have the
|
IsAccessibilityFocused |
Returns whether this View is accessibility focused. |
IsAttachedToWindow |
Returns true if this view is currently attached to a window. |
IsCredential |
Gets the mode for determining whether this view is a credential. -or- Sets whether this view is a credential for Credential Manager purposes. |
IsDirty |
True if this view has changed since the last time being drawn. |
IsFocused |
Returns true if this view has focus |
IsHandwritingDelegate |
Returns whether this view has been set as a handwriting delegate by |
IsHardwareAccelerated |
Indicates whether this view is attached to a hardware accelerated window or not. |
IsImportantForAccessibility |
Computes whether this view should be exposed for accessibility. |
IsImportantForAutofill |
Hints the Android System whether the |
IsImportantForContentCapture |
Hints the Android System whether this view is considered important for content capture, based
on the value explicitly set by |
IsInEditMode |
Indicates whether this View is currently in edit mode. |
IsInLayout |
Returns whether the view hierarchy is currently undergoing a layout pass. |
IsInTouchMode |
Returns the touch mode state associated with this view. |
IsLaidOut |
Returns true if this view has been through at least one layout since it was last attached to or detached from a window. |
IsLayoutDirectionResolved | |
IsLayoutRequested |
Indicates whether or not this view's layout will be requested during the next hierarchy layout pass. |
IsOpaque |
Indicates whether this View is opaque. |
IsPaddingOffsetRequired |
If the View draws content inside its padding and enables fading edges, it needs to support padding offsets. |
IsPaddingRelative |
Return if the padding has been set through relative values
|
IsPivotSet |
Returns whether or not a pivot has been set by a call to |
IsScrollContainer |
Indicates whether this view is one of the set of scrollable containers in its window. |
IsShowingLayoutBounds |
Returns |
IsShown |
Returns the visibility of this view and all of its ancestors |
IsTemporarilyDetached |
Tells whether the |
IsTextAlignmentResolved | |
IsTextDirectionResolved | |
JniIdentityHashCode | (Inherited from Object) |
JniPeerMembers | |
KeepScreenOn |
Returns whether the screen should remain on, corresponding to the current
value of |
KeyboardNavigationCluster |
Returns whether this View is a root of a keyboard navigation cluster. -or- Set whether this view is a root of a keyboard navigation cluster. |
KeyDispatcherState |
Return the global |
LabelFor |
Gets the id of a view for which this view serves as a label for accessibility purposes. -or- Sets the id of a view for which this view serves as a label for accessibility purposes. |
LayerType |
Indicates what type of layer is currently associated with this view. |
LayoutDirection |
Returns the resolved layout direction for this view. -or- Set the layout direction for this view. |
LayoutParameters |
Get the LayoutParams associated with this view. -or- Set the layout parameters associated with this view. |
Left |
Left position of this view relative to its parent. -or- Sets the left position of this view relative to its parent. |
LeftFadingEdgeStrength |
Returns the strength, or intensity, of the left faded edge. |
LeftPaddingOffset |
Amount by which to extend the left fading region. |
LongClickable |
Indicates whether this view reacts to long click events or not. -or- Enables or disables long click events for this view. |
Matrix |
The transform matrix of this view, which is calculated based on the current rotation, scale, and pivot properties. |
MeasuredHeight |
Like |
MeasuredHeightAndState |
Return the full height measurement information for this view as computed
by the most recent call to |
MeasuredState |
Return only the state bits of |
MeasuredWidth |
Like |
MeasuredWidthAndState |
Return the full width measurement information for this view as computed
by the most recent call to |
MinimumHeight |
Returns the minimum height of the view. |
MinimumWidth |
Returns the minimum width of the view. |
NestedScrollingEnabled |
Returns true if nested scrolling is enabled for this view. -or- Enable or disable nested scrolling for this view. |
NextClusterForwardId |
Gets the id of the root of the next keyboard navigation cluster. -or- Sets the id of the view to use as the root of the next keyboard navigation cluster. |
NextFocusDownId |
Gets the id of the view to use when the next focus is |
NextFocusForwardId |
Gets the id of the view to use when the next focus is |
NextFocusLeftId |
Gets the id of the view to use when the next focus is |
NextFocusRightId |
Gets the id of the view to use when the next focus is |
NextFocusUpId |
Gets the id of the view to use when the next focus is |
OnFocusChangeListener |
Returns the focus-change callback registered for this view. -or- Register a callback to be invoked when focus of this view changed. |
OutlineAmbientShadowColor | |
OutlineProvider |
Returns the current |
OutlineSpotShadowColor | |
Overlay |
Returns the overlay for this view, creating it if it does not yet exist. |
OverScrollMode |
Returns the over-scroll mode for this view. -or- Set the over-scroll mode for this view. |
PaddingBottom |
Returns the bottom padding of this view. |
PaddingEnd |
Returns the end padding of this view depending on its resolved layout direction. |
PaddingLeft |
Returns the left padding of this view. |
PaddingRight |
Returns the right padding of this view. |
PaddingStart |
Returns the start padding of this view depending on its resolved layout direction. |
PaddingTop |
Returns the top padding of this view. |
Parent |
Gets the parent of this view. |
ParentForAccessibility |
Gets the parent for accessibility purposes. |
PeerReference | (Inherited from Object) |
PivotX |
The x location of the point around which the view is |
PivotY |
The y location of the point around which the view is |
PointerIcon |
Gets the mouse pointer icon for the current view. -or- Set the pointer icon to be used for a mouse pointer in the current view. |
PreferKeepClear |
Retrieve the preference for this view to be kept clear. -or- Set a preference to keep the bounds of this view clear from floating windows above this view's window. |
PreferKeepClearRects |
Set a preference to keep the provided rects clear from floating windows above this view's window. |
Pressed |
Indicates whether the view is currently in pressed state. -or- Sets the pressed state for this view. |
PressedEnabledFocusedSelectedStateSet |
Indicates the view is pressed, enabled, focused and selected. |
PressedEnabledFocusedSelectedWindowFocusedStateSet |
Indicates the view is pressed, enabled, focused, selected and its window has the focus. |
PressedEnabledFocusedStateSet |
Indicates the view is pressed, enabled and focused. |
PressedEnabledFocusedWindowFocusedStateSet |
Indicates the view is pressed, enabled, focused and its window has the focus. |
PressedEnabledSelectedStateSet |
Indicates the view is pressed, enabled and selected. |
PressedEnabledSelectedWindowFocusedStateSet |
Indicates the view is pressed, enabled, selected and its window has the focus. |
PressedEnabledStateSet |
Indicates the view is pressed and enabled. |
PressedEnabledWindowFocusedStateSet |
Indicates the view is pressed, enabled and its window has the focus. |
PressedFocusedSelectedStateSet |
Indicates the view is pressed, focused and selected. |
PressedFocusedSelectedWindowFocusedStateSet |
Indicates the view is pressed, focused, selected and its window has the focus. |
PressedFocusedStateSet |
Indicates the view is pressed and focused. |
PressedFocusedWindowFocusedStateSet |
Indicates the view is pressed, focused and its window has the focus. |
PressedSelectedStateSet |
Indicates the view is pressed and selected. |
PressedSelectedWindowFocusedStateSet |
Indicates the view is pressed, selected and its window has the focus. |
PressedStateSet |
Indicates the view is pressed. |
PressedWindowFocusedStateSet |
Indicates the view is pressed and its window has the focus. |
Resources |
Returns the resources associated with this view. |
RevealOnFocusHint |
Returns this view's preference for reveal behavior when it gains focus. -or- Sets this view's preference for reveal behavior when it gains focus. |
Right |
Right position of this view relative to its parent. -or- Sets the right position of this view relative to its parent. |
RightFadingEdgeStrength |
Returns the strength, or intensity, of the right faded edge. |
RightPaddingOffset |
Amount by which to extend the right fading region. |
RootSurfaceControl |
The AttachedSurfaceControl itself is not a View, it is just the interface to the windowing-system object that contains the entire view hierarchy. |
RootView |
Finds the topmost view in the current view hierarchy. |
RootWindowInsets |
Provide original WindowInsets that are dispatched to the view hierarchy. |
Rotation |
The degrees that the view is rotated around the pivot point. -or- Sets the degrees that the view is rotated around the pivot point. |
RotationX |
The degrees that the view is rotated around the horizontal axis through the pivot point. -or- Sets the degrees that the view is rotated around the horizontal axis through the pivot point. |
RotationY |
The degrees that the view is rotated around the vertical axis through the pivot point. -or- Sets the degrees that the view is rotated around the vertical axis through the pivot point. |
SaveEnabled |
Indicates whether this view will save its state (that is,
whether its |
SaveFromParentEnabled |
Indicates whether the entire hierarchy under this view will save its state when a state saving traversal occurs from its parent. -or- Controls whether the entire hierarchy under this view will save its state when a state saving traversal occurs from its parent. |
ScaleX |
The amount that the view is scaled in x around the pivot point, as a proportion of the view's unscaled width. -or- Sets the amount that the view is scaled in x around the pivot point, as a proportion of the view's unscaled width. |
ScaleXs |
A Property wrapper around the |
ScaleY |
The amount that the view is scaled in y around the pivot point, as a proportion of the view's unscaled height. -or- Sets the amount that the view is scaled in Y around the pivot point, as a proportion of the view's unscaled width. |
ScaleYs |
A Property wrapper around the |
ScreenReaderFocusable |
Returns whether the view should be treated as a focusable unit by screen reader accessibility tools. -or- Sets whether this View should be a focusable element for screen readers and include non-focusable Views from its subtree when providing feedback. |
ScrollBarDefaultDelayBeforeFade |
Returns the delay before scrollbars fade. -or- Define the delay before scrollbars fade. |
ScrollBarFadeDuration |
Returns the scrollbar fade duration. -or- Define the scrollbar fade duration. |
ScrollbarFadingEnabled |
Returns true if scrollbars will fade when this view is not scrolling -or- Define whether scrollbars will fade when the view is not scrolling. |
ScrollBarSize |
Returns the scrollbar size. -or- Define the scrollbar size. |
ScrollBarStyle |
Returns the current scrollbar style. -or- Specify the style of the scrollbars. |
ScrollCaptureHint |
Returns the current scroll capture hint for this view. -or- Sets the scroll capture hint for this View. |
ScrollIndicators |
Returns a bitmask representing the enabled scroll indicators. |
ScrollX |
Return the scrolled left position of this view. -or- Set the horizontal scrolled position of your view. |
ScrollY |
Return the scrolled top position of this view. -or- Set the vertical scrolled position of your view. |
Selected |
Indicates the selection state of this view. -or- Changes the selection state of this view. |
SelectedStateSet |
Indicates the view is selected. |
SelectedWindowFocusedStateSet |
Indicates the view is selected and that its window has the focus. |
SolidColor |
Override this if your view is known to always be drawn on top of a solid color background, and needs to draw fading edges. |
SoundEffectsEnabled |
Set whether this view should have sound effects enabled for events such as clicking and touching. |
SourceLayoutResId |
A |
StateDescription | |
StateDescriptionFormatted |
Returns the |
StateListAnimator |
Returns the current StateListAnimator if exists. -or- Attaches the provided StateListAnimator to this View. |
SuggestedMinimumHeight |
Returns the suggested minimum height that the view should use. |
SuggestedMinimumWidth |
Returns the suggested minimum width that the view should use. |
SystemGestureExclusionRects |
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. -or- 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. |
SystemUiFlags | |
SystemUiVisibility |
Obsolete.
Returns the last |
Tag |
Returns this view's tag. -or- Sets the tag associated with this view. |
TextAlignment |
Return the resolved text alignment. -or- Set the text alignment. |
TextDirection |
Return the resolved text direction. -or- Set the text direction. |
ThresholdClass |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. |
ThresholdType |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. |
TooltipText | |
TooltipTextFormatted |
Returns the view's tooltip text. -or- Sets the tooltip text which will be displayed in a small popup next to the view. |
Top |
Top position of this view relative to its parent. -or- Sets the top position of this view relative to its parent. |
TopFadingEdgeStrength |
Returns the strength, or intensity, of the top faded edge. |
TopPaddingOffset |
Amount by which to extend the top fading region. |
Touchables |
Find and return all touchable views that are descendants of this view, possibly including this view if it is touchable itself. |
TouchDelegate |
Gets the TouchDelegate for this View. -or- Sets the TouchDelegate for this View. |
TransitionAlpha |
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. -or- 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. |
TransitionName |
Returns the name of the View to be used to identify Views in Transitions. -or- Sets the name of the View to be used to identify Views in Transitions. |
TranslationX |
The horizontal location of this view relative to its |
TranslationY |
The vertical location of this view relative to its |
TranslationZ |
The depth location of this view relative to its |
UniqueDrawingId |
Get the identifier used for this view by the drawing system. |
VerticalFadingEdgeEnabled |
Indicate whether the vertical edges are faded when the view is scrolled horizontally. -or- Define whether the vertical edges should be faded when this view is scrolled vertically. |
VerticalFadingEdgeLength |
Returns the size of the vertical faded edges used to indicate that more content in this view is visible. |
VerticalScrollBarEnabled |
Indicate whether the vertical scrollbar should be drawn or not. -or- Define whether the vertical scrollbar should be drawn or not. |
VerticalScrollbarPosition |
Set the position of the vertical scroll bar. |
VerticalScrollbarThumbDrawable |
Returns the currently configured Drawable for the thumb of the vertical scroll bar if it exists, null otherwise. -or- Defines the vertical scrollbar thumb drawable |
VerticalScrollbarTrackDrawable |
Returns the currently configured Drawable for the track of the vertical scroll bar if it exists, null otherwise. -or- Defines the vertical scrollbar track drawable |
VerticalScrollbarWidth |
Returns the width of the vertical scrollbar. |
ViewTranslationResponse |
Returns the |
ViewTreeObserver |
Returns the ViewTreeObserver for this view's hierarchy. |
Visibility |
Returns the visibility status for this view. -or- Set the visibility state of this view. |
Width |
Return the width of your view. |
WindowAttachCount | |
WindowFocusedStateSet |
Indicates the view's window has focus. |
WindowId |
Retrieve the |
WindowInsetsController |
Retrieves the single |
WindowSystemUiVisibility |
Returns the current system UI visibility that is currently set for the entire window. |
WindowToken |
Retrieve a unique token identifying the window this view is attached to. |
WindowVisibility |
Returns the current visibility of the window this view is attached to
(either |
X |
A Property wrapper around the |
Y |
A Property wrapper around the |
Z |
A Property wrapper around the |
Methods
AddChildrenForAccessibility(IList<View>) |
Adds the children of this View relevant for accessibility to the given list as output. |
AddExtraDataToAccessibilityNodeInfo(AccessibilityNodeInfo, String, Bundle) |
Adds extra data to an |
AddFocusables(IList<View>, FocusSearchDirection) |
Add any focusable views that are descendants of this view (possibly including this view if it is focusable itself) to views. |
AddFocusables(IList<View>, FocusSearchDirection, FocusablesFlags) |
Adds any focusable views that are descendants of this view (possibly including this view if it is focusable itself) to views. |
AddKeyboardNavigationClusters(ICollection<View>, FocusSearchDirection) |
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. |
AddOnAttachStateChangeListener(View+IOnAttachStateChangeListener) |
Add a listener for attach state changes. |
AddOnLayoutChangeListener(View+IOnLayoutChangeListener) |
Add a listener that will be called when the bounds of the view change due to layout processing. |
AddOnUnhandledKeyEventListener(View+IOnUnhandledKeyEventListener) |
Adds a listener which will receive unhandled |
AddTouchables(IList<View>) |
Add any touchable views that are descendants of this view (possibly including this view if it is touchable itself) to views. |
Animate() |
This method returns a ViewPropertyAnimator object, which can be used to animate specific properties on this View. |
AnnounceForAccessibility(ICharSequence) |
Convenience method for sending a |
AnnounceForAccessibility(String) |
Convenience method for sending a |
Autofill(AutofillValue) |
Automatically fills the content of this view with the |
Autofill(SparseArray) |
Automatically fills the content of the virtual children within this view. |
AwakenScrollBars() |
Trigger the scrollbars to draw. |
AwakenScrollBars(Int32) |
Trigger the scrollbars to draw. |
AwakenScrollBars(Int32, Boolean) |
Trigger the scrollbars to draw. |
BringToFront() |
Change the view's z order in the tree, so it's on top of other sibling views. |
BuildDrawingCache() |
Calling this method is equivalent to calling |
BuildDrawingCache(Boolean) |
Forces the drawing cache to be built if the drawing cache is invalid. |
BuildLayer() |
Forces this view's layer to be created and this view to be rendered into its layer. |
CallOnClick() |
Directly call any attached OnClickListener. |
CancelDragAndDrop() |
Cancels an ongoing drag and drop operation. |
CancelLongPress() |
Cancels a pending long press. |
CancelPendingInputEvents() |
Cancel any deferred high-level input events that were previously posted to the event queue. |
CanResolveLayoutDirection() |
Check if layout direction resolution can be done. |
CanResolveTextAlignment() |
Check if text alignment resolution can be done. |
CanResolveTextDirection() |
Check if text direction resolution can be done. |
CanScrollHorizontally(Int32) |
Check if this view can be scrolled horizontally in a certain direction. |
CanScrollVertically(Int32) |
Check if this view can be scrolled vertically in a certain direction. |
CheckInputConnectionProxy(View) |
Called by the |
ClearAnimation() |
Cancels any animations for this view. |
ClearFocus() |
Called when this view wants to give up focus. |
ClearViewTranslationCallback() |
Clear the |
Clone() |
Creates and returns a copy of this object. (Inherited from Object) |
CombineMeasuredStates(Int32, Int32) |
Merge two states as returned by |
ComputeHorizontalScrollExtent() |
Compute the horizontal extent of the horizontal scrollbar's thumb within the horizontal range. |
ComputeHorizontalScrollOffset() |
Compute the horizontal offset of the horizontal scrollbar's thumb within the horizontal range. |
ComputeHorizontalScrollRange() |
Compute the horizontal range that the horizontal scrollbar represents. |
ComputeScroll() |
Called by a parent to request that a child update its values for mScrollX and mScrollY if necessary. |
ComputeSystemWindowInsets(WindowInsets, Rect) |
Compute insets that should be consumed by this view and the ones that should propagate to those under it. |
ComputeVerticalScrollExtent() |
Compute the vertical extent of the vertical scrollbar's thumb within the vertical range. |
ComputeVerticalScrollOffset() |
Compute the vertical offset of the vertical scrollbar's thumb within the horizontal range. |
ComputeVerticalScrollRange() |
Compute the vertical range that the vertical scrollbar represents. |
CreateAccessibilityNodeInfo() |
Returns an |
CreateContextMenu(IContextMenu) |
Show the context menu for this view. |
DestroyDrawingCache() |
Frees the resources used by the drawing cache. |
DispatchApplyWindowInsets(WindowInsets) |
Request to apply the given window insets to this view or another view in its subtree. |
DispatchCapturedPointerEvent(MotionEvent) |
Pass a captured pointer event down to the focused view. |
DispatchConfigurationChanged(Configuration) |
Dispatch a notification about a resource configuration change down the view hierarchy. |
DispatchCreateViewTranslationRequest(IDictionary<AutofillId,Int64[]>, Int32[], TranslationCapability, IList<ViewTranslationRequest>) |
Dispatch to collect the |
DispatchDisplayHint(ViewStates) |
Dispatch a hint about whether this view is displayed. |
DispatchDragEvent(DragEvent) |
Detects if this View is enabled and has a drag event listener. |
DispatchDraw(Canvas) |
Called by draw to draw the child views. |
DispatchDrawableHotspotChanged(Single, Single) |
Dispatches drawableHotspotChanged to all of this View's children. |
DispatchFinishTemporaryDetach() |
Dispatch |
DispatchGenericFocusedEvent(MotionEvent) |
Dispatch a generic motion event to the currently focused view. |
DispatchGenericMotionEvent(MotionEvent) |
Dispatch a generic motion event. |
DispatchGenericPointerEvent(MotionEvent) |
Dispatch a generic motion event to the view under the first pointer. |
DispatchHoverEvent(MotionEvent) |
Dispatch a hover event. |
DispatchKeyEvent(KeyEvent) |
Dispatch a key event to the next view on the focus path. |
DispatchKeyEventPreIme(KeyEvent) |
Dispatch a key event before it is processed by any input method associated with the view hierarchy. |
DispatchKeyShortcutEvent(KeyEvent) |
Dispatches a key shortcut event. |
DispatchNestedFling(Single, Single, Boolean) |
Dispatch a fling to a nested scrolling parent. |
DispatchNestedPreFling(Single, Single) |
Dispatch a fling to a nested scrolling parent before it is processed by this view. |
DispatchNestedPrePerformAccessibilityAction(Action, Bundle) |
Report an accessibility action to this view's parents for delegated processing. |
DispatchNestedPreScroll(Int32, Int32, Int32[], Int32[]) |
Dispatch one step of a nested scroll in progress before this view consumes any portion of it. |
DispatchNestedScroll(Int32, Int32, Int32, Int32, Int32[]) |
Dispatch one step of a nested scroll in progress. |
DispatchPointerCaptureChanged(Boolean) | |
DispatchPopulateAccessibilityEvent(AccessibilityEvent) |
Dispatches an |
DispatchProvideAutofillStructure(ViewStructure, AutofillFlags) |
Dispatches creation of a |
DispatchProvideStructure(ViewStructure) |
Dispatch creation of |
DispatchRestoreInstanceState(SparseArray) |
Called by |
DispatchSaveInstanceState(SparseArray) |
Called by |
DispatchScrollCaptureSearch(Rect, Point, IConsumer) |
Dispatch a scroll capture search request down the view hierarchy. |
DispatchSetActivated(Boolean) |
Dispatch setActivated to all of this View's children. |
DispatchSetPressed(Boolean) |
Dispatch setPressed to all of this View's children. |
DispatchSetSelected(Boolean) |
Dispatch setSelected to all of this View's children. |
DispatchStartTemporaryDetach() |
Dispatch |
DispatchSystemUiVisibilityChanged(Int32) | |
DispatchSystemUiVisibilityChanged(SystemUiFlags) |
Dispatch callbacks to |
DispatchTouchEvent(MotionEvent) |
Pass the touch screen motion event down to the target view, or this view if it is the target. |
DispatchTrackballEvent(MotionEvent) |
Pass a trackball motion event down to the focused view. |
DispatchUnhandledMove(View, FocusSearchDirection) |
This method is the last chance for the focused view and its ancestors to respond to an arrow key. |
DispatchVisibilityChanged(View, ViewStates) |
Dispatch a view visibility change down the view hierarchy. |
DispatchWindowFocusChanged(Boolean) |
Called when the window containing this view gains or loses window focus. |
DispatchWindowInsetsAnimationEnd(WindowInsetsAnimation) |
Dispatches |
DispatchWindowInsetsAnimationPrepare(WindowInsetsAnimation) |
Dispatches |
DispatchWindowInsetsAnimationProgress(WindowInsets, IList<WindowInsetsAnimation>) |
Dispatches |
DispatchWindowInsetsAnimationStart(WindowInsetsAnimation, WindowInsetsAnimation+Bounds) |
Dispatches |
DispatchWindowSystemUiVisiblityChanged(SystemUiFlags) |
Dispatch callbacks to |
DispatchWindowVisibilityChanged(ViewStates) |
Dispatch a window visibility change down the view hierarchy. |
Dispose() | (Inherited from Object) |
Dispose(Boolean) | (Inherited from Object) |
Draw(Canvas) |
Manually render this view (and all of its children) to the given Canvas. |
DrawableHotspotChanged(Single, Single) |
This function is called whenever the view hotspot changes and needs to be propagated to drawables or child views managed by the view. |
DrawableStateChanged() |
This function is called whenever the state of the view changes in such a way that it impacts the state of drawables being shown. |
Equals(Object) |
Indicates whether some other object is "equal to" this one. (Inherited from Object) |
FindFocus() |
Find the view in the hierarchy rooted at this view that currently has focus. |
FindOnBackInvokedDispatcher() |
Walk up the View hierarchy to find the nearest |
FindViewById(Int32) |
Finds the first descendant view with the given ID, the view itself if
the ID matches |
FindViewById<T>(Int32) | |
FindViewsWithText(IList<View>, ICharSequence, FindViewsWith) |
Finds the Views that contain given text. |
FindViewsWithText(IList<View>, String, FindViewsWith) |
Finds the Views that contain given text. |
FindViewWithTag(Object) |
Look for a child view with the given tag. |
FitSystemWindows(Rect) |
Obsolete.
Called by the view hierarchy when the content insets for a window have changed, to allow it to adjust its content to fit within those windows. |
FocusSearch(FocusSearchDirection) |
Find the nearest view in the specified direction that can take focus. |
ForceHasOverlappingRendering(Boolean) |
Sets the behavior for overlapping rendering for this view (see |
ForceLayout() |
Forces this view to be laid out during the next layout pass. |
GatherTransparentRegion(Region) |
This is used by the ViewRoot to perform an optimization when the view hierarchy contains one or several SurfaceView. |
GenerateDisplayHash(String, Rect, IExecutor, IDisplayHashResultCallback) |
Called to generate a |
GenerateViewId() |
Generate a value suitable for use in |
GetAccessibilityDelegate() |
Returns the delegate for implementing accessibility support via composition. |
GetAttributeResolutionStack(Int32) |
Returns the ordered list of resource ID that are considered when resolving attribute values
for this |
GetAutofillHints() |
Gets the hints that help an |
GetClipBounds(Rect) |
Populates an output rectangle with the clip bounds of the view,
returning |
GetDefaultSize(Int32, Int32) |
Utility to return a default size. |
GetDrawableState() |
Return an array of resource IDs of the drawable states representing the current state of the view. |
GetDrawingCache(Boolean) |
Returns the bitmap in which this view drawing is cached. |
GetDrawingRect(Rect) |
Return the visible drawing bounds of your view. |
GetFocusable() |
Returns the focusable setting for this view. |
GetFocusables(FocusSearchDirection) |
Find and return all focusable views that are descendants of this view, possibly including this view if it is focusable itself. |
GetFocusedRect(Rect) |
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. |
GetGlobalVisibleRect(Rect) |
Sets |
GetGlobalVisibleRect(Rect, Point) |
Sets |
GetHashCode() |
Returns a hash code value for the object. (Inherited from Object) |
GetHasOverlappingRendering() |
Returns the value for overlapping rendering that is used internally. |
GetHitRect(Rect) |
Hit rectangle in parent's coordinates |
GetLocalVisibleRect(Rect) |
Sets |
GetLocationInSurface(Int32[]) |
Gets the coordinates of this view in the coordinate space of the
|
GetLocationInWindow(Int32[]) |
Gets the coordinates of this view in the coordinate space of the window that contains the view, irrespective of system decorations. |
GetLocationOnScreen(Int32[]) |
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. |
GetReceiveContentMimeTypes() |
Returns the MIME types accepted by |
GetTag(Int32) |
Returns the tag associated with this view and the specified key. |
GetWindowVisibleDisplayFrame(Rect) |
Retrieve the overall visible display size in which the window this view is attached to has been positioned in. |
GetX() |
The visual x position of this view, in pixels. |
GetY() |
The visual y position of this view, in pixels. |
GetZ() |
The visual z position of this view, in pixels. |
Inflate(Context, Int32, ViewGroup) |
Inflate a view from an XML resource. |
InitializeFadingEdge(TypedArray) |
Initializes the fading edges from a given set of styled attributes. |
InitializeScrollbars(TypedArray) |
Initializes the scrollbars from a given set of styled attributes. |
Invalidate() |
Invalidate the whole view. |
Invalidate(Int32, Int32, Int32, Int32) |
Mark the area defined by the rect (l,t,r,b) as needing to be drawn. |
Invalidate(Rect) |
Mark the area defined by dirty as needing to be drawn. |
InvalidateDrawable(Drawable) |
Invalidates the specified Drawable. |
InvalidateOutline() |
Called to rebuild this View's Outline from its |
InvokeFitsSystemWindows() | |
IsVisibleToUserForAutofill(Int32) |
Computes whether this virtual autofill view is visible to the user. |
JavaFinalize() |
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. (Inherited from Object) |
JumpDrawablesToCurrentState() |
Call |
KeyboardNavigationClusterSearch(View, FocusSearchDirection) |
Find the nearest keyboard navigation cluster in the specified direction. |
Layout(Int32, Int32, Int32, Int32) |
Assign a size and position to a view and all of its descendants |
Measure(Int32, Int32) |
This is called to find out how big a view should be. |
MergeDrawableStates(Int32[], Int32[]) |
Merge your own state values in <var>additionalState</var> into the base
state values <var>baseState</var> that were returned by
|
Notify() |
Wakes up a single thread that is waiting on this object's monitor. (Inherited from Object) |
NotifyAll() |
Wakes up all threads that are waiting on this object's monitor. (Inherited from Object) |
OffsetLeftAndRight(Int32) |
Offset this view's horizontal location by the specified amount of pixels. |
OffsetTopAndBottom(Int32) |
Offset this view's vertical location by the specified number of pixels. |
OnAnimationEnd() |
Invoked by a parent ViewGroup to notify the end of the animation currently associated with this view. |
OnAnimationStart() |
Invoked by a parent ViewGroup to notify the start of the animation currently associated with this view. |
OnApplyWindowInsets(WindowInsets) |
Called when the view should apply |
OnAttachedToWindow() |
This is called when the view is attached to a window. |
OnCancelPendingInputEvents() |
Called as the result of a call to |
OnCapturedPointerEvent(MotionEvent) |
Implement this method to handle captured pointer events |
OnCheckIsTextEditor() |
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. |
OnConfigurationChanged(Configuration) |
Called when the current configuration of the resources being used by the application have changed. |
OnCreateContextMenu(IContextMenu) |
Views should implement this if the view itself is going to add items to the context menu. |
OnCreateDrawableState(Int32) |
Generate the new |
OnCreateInputConnection(EditorInfo) |
Create a new InputConnection for an InputMethod to interact with the view. |
OnCreateViewTranslationRequest(Int32[], IConsumer) |
Collects a |
OnCreateVirtualViewTranslationRequests(Int64[], Int32[], IConsumer) |
Collects |
OnDetachedFromWindow() |
This is called when the view is detached from a window. |
OnDisplayHint(Int32) |
Gives this view a hint about whether is displayed or not. |
OnDragEvent(DragEvent) |
Handles drag events sent by the system following a call to
|
OnDraw(Canvas) |
Implement this to do your drawing. |
OnDrawForeground(Canvas) |
Draw any foreground content for this view. |
OnDrawScrollBars(Canvas) |
Request the drawing of the horizontal and the vertical scrollbar. |
OnFilterTouchEventForSecurity(MotionEvent) |
Filter the touch event to apply security policies. |
OnFinishInflate() |
Finalize inflating a view from XML. |
OnFinishTemporaryDetach() |
Called after |
OnFocusChanged(Boolean, FocusSearchDirection, Rect) |
Called by the view system when the focus state of this view changes. |
OnGenericMotionEvent(MotionEvent) |
Implement this method to handle generic motion events. |
OnHoverChanged(Boolean) |
Implement this method to handle hover state changes. |
OnHoverEvent(MotionEvent) |
Implement this method to handle hover events. |
OnInitializeAccessibilityEvent(AccessibilityEvent) |
Initializes an |
OnInitializeAccessibilityNodeInfo(AccessibilityNodeInfo) |
Initializes an |
OnKeyDown(Keycode, KeyEvent) |
Default implementation of |
OnKeyLongPress(Keycode, KeyEvent) |
Default implementation of |
OnKeyMultiple(Keycode, Int32, KeyEvent) |
Default implementation of |
OnKeyPreIme(Keycode, KeyEvent) |
Handle a key event before it is processed by any input method associated with the view hierarchy. |
OnKeyShortcut(Keycode, KeyEvent) |
Called on the focused view when a key shortcut event is not handled. |
OnKeyUp(Keycode, KeyEvent) |
Default implementation of |
OnLayout(Boolean, Int32, Int32, Int32, Int32) |
Called from layout when this view should assign a size and position to each of its children. |
OnMeasure(Int32, Int32) |
Measure the view and its content to determine the measured width and the measured height. |
OnOverScrolled(Int32, Int32, Boolean, Boolean) |
Called by |
OnPointerCaptureChange(Boolean) |
Called when the window has just acquired or lost pointer capture. |
OnPopulateAccessibilityEvent(AccessibilityEvent) |
Called from |
OnProvideAutofillStructure(ViewStructure, AutofillFlags) |
Populates a |
OnProvideAutofillVirtualStructure(ViewStructure, AutofillFlags) |
Populates a |
OnProvideContentCaptureStructure(ViewStructure, Int32) |
Populates a |
OnProvideStructure(ViewStructure) |
Called when assist structure is being retrieved from a view as part of
|
OnProvideVirtualStructure(ViewStructure) |
Called when assist structure is being retrieved from a view as part of
|
OnReceiveContent(ContentInfo) |
Implements the default behavior for receiving content for this type of view. |
OnResolvePointerIcon(MotionEvent, Int32) |
Resolve the pointer icon that should be used for specified pointer in the motion event. |
OnRestoreInstanceState(IParcelable) |
Hook allowing a view to re-apply a representation of its internal state that had previously
been generated by |
OnRtlPropertiesChanged(LayoutDirection) |
Called when any RTL property (layout direction or text direction or text alignment) has been changed. |
OnSaveInstanceState() |
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. |
OnScreenStateChanged(ScreenState) |
This method is called whenever the state of the screen this view is attached to changes. |
OnScrollCaptureSearch(Rect, Point, IConsumer) |
Called when scroll capture is requested, to search for appropriate content to scroll. |
OnScrollChanged(Int32, Int32, Int32, Int32) |
This is called in response to an internal scroll in this view (i. |
OnSetAlpha(Int32) |
Invoked if there is a Transform that involves alpha. |
OnSizeChanged(Int32, Int32, Int32, Int32) |
This is called during layout when the size of this view has changed. |
OnStartTemporaryDetach() |
This is called when a container is going to temporarily detach a child, with
|
OnTouchEvent(MotionEvent) |
Implement this method to handle touch screen motion events. |
OnTrackballEvent(MotionEvent) |
Implement this method to handle trackball motion events. |
OnViewTranslationResponse(ViewTranslationResponse) |
Called when the content from |
OnVirtualViewTranslationResponses(LongSparseArray) |
Called when the content from |
OnVisibilityAggregated(Boolean) |
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. |
OnVisibilityChanged(View, ViewStates) |
Called when the visibility of the view or an ancestor of the view has changed. |
OnWindowFocusChanged(Boolean) |
Called when the window containing this view gains or loses focus. |
OnWindowSystemUiVisibilityChanged(SystemUiFlags) |
Override to find out when the window's requested system UI visibility
has changed, that is the value returned by |
OnWindowVisibilityChanged(ViewStates) |
Called when the window containing has change its visibility
(between |
OverScrollBy(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Boolean) |
Scroll the view with standard behavior for scrolling beyond the normal content boundaries. |
PerformAccessibilityAction(Action, Bundle) |
Performs the specified accessibility action on the view. |
PerformAccessibilityAction(GlobalAction, Bundle) |
Obsolete.
Performs the specified accessibility action on the view. |
PerformClick() |
Call this view's OnClickListener, if it is defined. |
PerformContextClick() |
Call this view's OnContextClickListener, if it is defined. |
PerformContextClick(Single, Single) |
Call this view's OnContextClickListener, if it is defined. |
PerformHapticFeedback(FeedbackConstants) |
BZZZTT!!1! |
PerformHapticFeedback(FeedbackConstants, FeedbackFlags) |
BZZZTT!!1! |
PerformLongClick() |
Calls this view's OnLongClickListener, if it is defined. |
PerformLongClick(Single, Single) |
Calls this view's OnLongClickListener, if it is defined. |
PerformReceiveContent(ContentInfo) |
Receives the given content. |
PlaySoundEffect(SoundEffects) |
Play a sound effect for this view. |
Post(Action) | |
Post(IRunnable) |
Causes the Runnable to be added to the message queue. |
PostDelayed(Action, Int64) | |
PostDelayed(IRunnable, Int64) |
Causes the Runnable to be added to the message queue, to be run after the specified amount of time elapses. |
PostInvalidate() |
Cause an invalidate to happen on a subsequent cycle through the event loop. |
PostInvalidate(Int32, Int32, Int32, Int32) |
Cause an invalidate of the specified area to happen on a subsequent cycle through the event loop. |
PostInvalidateDelayed(Int64) |
Cause an invalidate to happen on a subsequent cycle through the event loop. |
PostInvalidateDelayed(Int64, Int32, Int32, Int32, Int32) |
Cause an invalidate of the specified area to happen on a subsequent cycle through the event loop. |
PostInvalidateOnAnimation() |
Cause an invalidate to happen on the next animation time step, typically the next display frame. |
PostInvalidateOnAnimation(Int32, Int32, Int32, Int32) |
Cause an invalidate of the specified area to happen on the next animation time step, typically the next display frame. |
PostOnAnimation(IRunnable) |
Causes the Runnable to execute on the next animation time step. |
PostOnAnimationDelayed(IRunnable, Int64) |
Causes the Runnable to execute on the next animation time step, after the specified amount of time elapses. |
RefreshDrawableState() |
Call this to force a view to update its drawable state. |
ReleasePointerCapture() |
Releases the pointer capture. |
RemoveCallbacks(Action) | |
RemoveCallbacks(IRunnable) |
Removes the specified Runnable from the message queue. |
RemoveOnAttachStateChangeListener(View+IOnAttachStateChangeListener) |
Remove a listener for attach state changes. |
RemoveOnLayoutChangeListener(View+IOnLayoutChangeListener) |
Remove a listener for layout changes. |
RemoveOnUnhandledKeyEventListener(View+IOnUnhandledKeyEventListener) |
Removes a listener which will receive unhandled |
RequestApplyInsets() |
Ask that a new dispatch of |
RequestFitSystemWindows() |
Obsolete.
Ask that a new dispatch of |
RequestFocus() |
Call this to try to give focus to a specific view or to one of its descendants. |
RequestFocus(FocusSearchDirection) |
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. |
RequestFocus(FocusSearchDirection, Rect) |
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. |
RequestFocusFromTouch() |
Call this to try to give focus to a specific view or to one of its descendants. |
RequestLayout() |
Call this when something has changed which has invalidated the layout of this view. |
RequestPointerCapture() |
Requests pointer capture mode. |
RequestRectangleOnScreen(Rect) |
Request that a rectangle of this view be visible on the screen, scrolling if necessary just enough. |
RequestRectangleOnScreen(Rect, Boolean) |
Request that a rectangle of this view be visible on the screen, scrolling if necessary just enough. |
RequestUnbufferedDispatch(Int32) |
Request unbuffered dispatch of the given event source class to this view. |
RequestUnbufferedDispatch(MotionEvent) |
Request unbuffered dispatch of the given stream of MotionEvents to this View. |
RequireViewById(Int32) |
Finds the first descendant view with the given ID, the view itself if the ID matches
|
RequireViewById<T>(Int32) | |
ResetPivot() |
Clears any pivot previously set by a call to |
ResolveSize(Int32, Int32) |
Version of |
ResolveSizeAndState(Int32, Int32, Int32) |
Utility to reconcile a desired size and state, with constraints imposed by a MeasureSpec. |
RestoreDefaultFocus() |
Gives focus to the default-focus view in the view hierarchy that has this view as a root. |
RestoreHierarchyState(SparseArray) |
Restore this view hierarchy's frozen state from the given container. |
SaveAttributeDataForStyleable(Context, Int32[], IAttributeSet, TypedArray, Int32, Int32) |
Stores debugging information about attributes. |
SaveHierarchyState(SparseArray) |
Store this view hierarchy's frozen state into the given container. |
ScheduleDrawable(Drawable, Action, Int64) | |
ScheduleDrawable(Drawable, IRunnable, Int64) |
Schedules an action on a drawable to occur at a specified time. |
ScrollBy(Int32, Int32) |
Move the scrolled position of your view. |
ScrollTo(Int32, Int32) |
Set the scrolled position of your view. |
SendAccessibilityEvent(EventTypes) |
Sends an accessibility event of the given type. |
SendAccessibilityEventUnchecked(AccessibilityEvent) |
This method behaves exactly as |
SetAccessibilityDataSensitive(AccessibilityDataSensitive) |
Specifies whether this view should only allow interactions from
|
SetAccessibilityDelegate(View+AccessibilityDelegate) |
Sets a delegate for implementing accessibility support via composition (as opposed to inheritance). |
SetAllowClickWhenDisabled(Boolean) |
Enables or disables click events for this view when disabled. |
SetAllowedHandwritingDelegatePackage(String) |
Specifies that this view may act as a handwriting initiation delegator for a delegate editor view from the specified package. |
SetAllowedHandwritingDelegatorPackage(String) |
Specifies that a view from the specified package may act as a handwriting delegator for this delegate editor view. |
SetAutofillHints(String[]) |
Sets the hints that help an |
SetBackgroundColor(Color) |
Sets the background color for this view. |
SetBackgroundDrawable(Drawable) |
Obsolete.
This member is deprecated. |
SetBackgroundResource(Int32) |
Set the background to a given resource. |
SetCameraDistance(Single) |
Sets the distance along the Z axis (orthogonal to the X/Y plane on which views are drawn) from the camera to this view. |
SetFadingEdgeLength(Int32) |
Set the size of the faded edge used to indicate that more content in this view is available. |
SetFitsSystemWindows(Boolean) |
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 |
SetFocusable(ViewFocusability) |
Sets whether this view can receive focus. |
SetForegroundGravity(GravityFlags) |
Describes how the foreground is positioned. |
SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
SetHandwritingBoundsOffsets(Single, Single, Single, Single) |
Set the amount of offset applied to this view's stylus handwriting bounds. |
SetLayerPaint(Paint) |
Updates the |
SetLayerType(LayerType, Paint) |
Specifies the type of layer backing this view. |
SetLeftTopRightBottom(Int32, Int32, Int32, Int32) |
Assign a size and position to this view. |
SetMeasuredDimension(Int32, Int32) |
This method must be called by |
SetMinimumHeight(Int32) |
Sets the minimum height of the view. |
SetMinimumWidth(Int32) |
Sets the minimum width of the view. |
SetOnApplyWindowInsetsListener(View+IOnApplyWindowInsetsListener) |
Set an |
SetOnCapturedPointerListener(View+IOnCapturedPointerListener) |
Set a listener to receive callbacks when the pointer capture state of a view changes. |
SetOnClickListener(View+IOnClickListener) |
Register a callback to be invoked when this view is clicked. |
SetOnContextClickListener(View+IOnContextClickListener) |
Register a callback to be invoked when this view is context clicked. |
SetOnCreateContextMenuListener(View+IOnCreateContextMenuListener) |
Register a callback to be invoked when the context menu for this view is being built. |
SetOnDragListener(View+IOnDragListener) |
Register a drag event listener callback object for this View. |
SetOnGenericMotionListener(View+IOnGenericMotionListener) |
Register a callback to be invoked when a generic motion event is sent to this view. |
SetOnHoverListener(View+IOnHoverListener) |
Register a callback to be invoked when a hover event is sent to this view. |
SetOnKeyListener(View+IOnKeyListener) |
Register a callback to be invoked when a hardware key is pressed in this view. |
SetOnLongClickListener(View+IOnLongClickListener) |
Register a callback to be invoked when this view is clicked and held. |
SetOnReceiveContentListener(String[], IOnReceiveContentListener) |
Sets the listener to be |
SetOnScrollChangeListener(View+IOnScrollChangeListener) |
Register a callback to be invoked when the scroll X or Y positions of this view change. |
SetOnSystemUiVisibilityChangeListener(View+IOnSystemUiVisibilityChangeListener) |
Set a listener to receive callbacks when the visibility of the system bar changes. |
SetOnTouchListener(View+IOnTouchListener) |
Register a callback to be invoked when a touch event is sent to this view. |
SetOutlineAmbientShadowColor(Color) |
Sets the color of the ambient shadow that is drawn when the view has a positive Z or elevation value. |
SetOutlineSpotShadowColor(Color) |
Sets the color of the spot shadow that is drawn when the view has a positive Z or elevation value. |
SetPadding(Int32, Int32, Int32, Int32) |
Sets the padding. |
SetPaddingRelative(Int32, Int32, Int32, Int32) |
Sets the relative padding. |
SetRenderEffect(RenderEffect) |
Configure the |
SetScrollCaptureCallback(IScrollCaptureCallback) |
Sets the callback to receive scroll capture requests. |
SetScrollContainer(Boolean) |
Change whether this view is one of the set of scrollable containers in its window. |
SetScrollIndicators(Int32) |
Sets the state of all scroll indicators. |
SetScrollIndicators(Int32, Int32) |
Sets the state of the scroll indicators specified by the mask. |
SetTag(Int32, Object) |
Sets a tag associated with this view and a key. |
SetTransitionVisibility(ViewStates) |
Changes the visibility of this View without triggering any other changes. |
SetViewTranslationCallback(IViewTranslationCallback) |
Sets a |
SetWillNotCacheDrawing(Boolean) |
When a View's drawing cache is enabled, drawing is redirected to an offscreen bitmap. |
SetWillNotDraw(Boolean) |
If this view doesn't do any drawing on its own, set this flag to allow further optimizations. |
SetWindowInsetsAnimationCallback(WindowInsetsAnimation+Callback) |
Sets a |
SetX(Single) |
Sets the visual x position of this view, in pixels. |
SetY(Single) |
Sets the visual y position of this view, in pixels. |
SetZ(Single) |
Sets the visual z position of this view, in pixels. |
ShowContextMenu() |
Shows the context menu for this view. |
ShowContextMenu(Single, Single) |
Shows the context menu for this view anchored to the specified view-relative coordinate. |
StartActionMode(ActionMode+ICallback) |
Start an action mode with the default type |
StartActionMode(ActionMode+ICallback, ActionModeType) |
Start an action mode with the default type |
StartAnimation(Animation) |
Start the specified animation now. |
StartDrag(ClipData, View+DragShadowBuilder, Object, Int32) |
Starts a drag and drop operation. |
StartDragAndDrop(ClipData, View+DragShadowBuilder, Object, Int32) |
Starts a drag and drop operation. |
StartNestedScroll(ScrollAxis) |
Begin a nestable scroll operation along the given axes. |
StopNestedScroll() |
Stop a nested scroll in progress. |
ToArray<T>() | (Inherited from Object) |
ToString() |
Returns a string representation of the object. (Inherited from Object) |
TransformMatrixToGlobal(Matrix) |
Modifies the input matrix such that it maps view-local coordinates to on-screen coordinates. |
TransformMatrixToLocal(Matrix) |
Modifies the input matrix such that it maps on-screen coordinates to view-local coordinates. |
UnregisterFromRuntime() | (Inherited from Object) |
UnscheduleDrawable(Drawable) |
Unschedule any events associated with the given Drawable. |
UnscheduleDrawable(Drawable, Action) | |
UnscheduleDrawable(Drawable, IRunnable) |
Cancels a scheduled action on a drawable. |
UpdateDragShadow(View+DragShadowBuilder) |
Updates the drag shadow for the ongoing drag and drop operation. |
VerifyDrawable(Drawable) |
If your view subclass is displaying its own Drawable objects, it should override this function and return true for any Drawable it is displaying. |
Wait() |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>. (Inherited from Object) |
Wait(Int64) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
Wait(Int64, Int32) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
WillNotCacheDrawing() |
Returns whether or not this View can cache its drawing or not. |
WillNotDraw() |
Returns whether or not this View draws on its own. |
Events
Explicit Interface Implementations
IJavaPeerable.Disposed() | (Inherited from Object) |
IJavaPeerable.DisposeUnlessReferenced() | (Inherited from Object) |
IJavaPeerable.Finalized() | (Inherited from Object) |
IJavaPeerable.JniManagedPeerState | (Inherited from Object) |
IJavaPeerable.SetJniIdentityHashCode(Int32) | (Inherited from Object) |
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) | (Inherited from Object) |
IJavaPeerable.SetPeerReference(JniObjectReference) | (Inherited from Object) |
Extension Methods
JavaCast<TResult>(IJavaObject) |
Performs an Android runtime-checked type conversion. |
JavaCast<TResult>(IJavaObject) | |
GetJniTypeName(IJavaPeerable) |