This class represents a delegate that can be registered in a View to enhance accessibility support via composition rather via inheritance.

Base class for derived classes that want to save and restore their own state in View.onSaveInstanceState() .

Creates an image that the system displays during the drag and drop operation.

Listener for applying window insets on a view in a custom way.

Interface definition for a callback to be invoked when this view is attached or detached from its window.

Interface definition for a callback to be invoked when a captured pointer event is being dispatched this view.

Interface definition for a callback to be invoked when a view is clicked.

Interface definition for a callback to be invoked when a view is context clicked.

Interface definition for a callback to be invoked when the context menu for this view is being built.

Interface definition for a callback to be invoked when a drag is being dispatched to this view.

Interface definition for a callback to be invoked when the focus state of a view changed.

Interface definition for a callback to be invoked when a generic motion event is dispatched to this view.

Interface definition for a callback to be invoked when a hover event is dispatched to this view.

Interface definition for a callback to be invoked when a hardware key event is dispatched to this view.

Interface definition for a callback to be invoked when the layout bounds of a view changes due to layout processing.

Interface definition for a callback to be invoked when a view has been clicked and held.

Interface definition for a callback to be invoked when the scroll X or Y positions of a view change.

This interface was deprecated in API level 30. Use WindowInsets#isVisible(int) to find out about system bar visibilities by setting a OnApplyWindowInsetsListener on this view.

Interface definition for a callback to be invoked when a touch event is dispatched to this view.

Interface definition for a callback to be invoked when a hardware key event hasn't been handled by the view hierarchy.

XML attributes

android:accessibilityHeading Whether or not this view is a heading for accessibility purposes.

android:accessibilityLiveRegion Indicates to accessibility services whether the user should be notified when this view changes.

android:accessibilityPaneTitle The title this view should present to accessibility as a pane title.

android:accessibilityTraversalAfter Sets the id of a view after which this one is visited in accessibility traversal.

android:accessibilityTraversalBefore Sets the id of a view before which this one is visited in accessibility traversal.

android:alpha alpha property of the view, as a value between 0 (completely transparent) and 1 (completely opaque).

android:autofillHints Describes the content of a view so that a autofill service can fill in the appropriate data.

android:autofilledHighlight Drawable to be drawn over the view to mark it as autofilled May be a reference to another resource, in the form " @[+][package:]type/name " or a theme attribute in the form " ?[package:]type/name ".

android:background A drawable to use as the background.

android:backgroundTint Tint to apply to the background.

android:backgroundTintMode Blending mode used to apply the background tint.

android:clickable Defines whether this view reacts to click events.

android:contentDescription Defines text that briefly describes content of the view.

android:contextClickable Defines whether this view reacts to context click events.

android:defaultFocusHighlightEnabled Whether this View should use a default focus highlight when it gets focused but doesn't have R.attr.state_focused defined in its background.

android:drawingCacheQuality Defines the quality of translucent drawing caches.

android:duplicateParentState When this attribute is set to true, the view gets its drawable state (focused, pressed, etc.) from its direct parent rather than from itself.

android:elevation base z depth of the view.

android:fadeScrollbars Defines whether to fade out scrollbars when they are not in use.

android:fadingEdgeLength Defines the length of the fading edges.

android:filterTouchesWhenObscured Specifies whether to filter touches when the view's window is obscured by another visible window.

android:fitsSystemWindows Boolean internal attribute to adjust view layout based on system windows such as the status bar.

android:focusable Controls whether a view can take focus.

android:focusableInTouchMode Boolean that controls whether a view can take focus while in touch mode.

android:focusedByDefault Whether this view is a default-focus view.

android:forceHasOverlappingRendering Whether this view has elements that may overlap when drawn.

android:foreground Defines the drawable to draw over the content.

android:foregroundGravity Defines the gravity to apply to the foreground drawable.

android:foregroundTint Tint to apply to the foreground.

android:foregroundTintMode Blending mode used to apply the foreground tint.

android:hapticFeedbackEnabled Boolean that controls whether a view should have haptic feedback enabled for events such as long presses.

android:id Supply an identifier name for this view, to later retrieve it with View.findViewById() or Activity.findViewById() .

android:importantForAccessibility Describes whether or not this view is important for accessibility.

android:importantForAutofill Hints the Android System whether the view node associated with this View should be included in a view structure used for autofill purposes.

android:importantForContentCapture Hints the Android System whether the view node associated with this View should be use for content capture purposes.

android:isScrollContainer Set this if the view will serve as a scrolling container, meaning that it can be resized to shrink its overall window so that there will be space for an input method.

android:keepScreenOn Controls whether the view's window should keep the screen on while visible.

android:keyboardNavigationCluster Whether this view is a root of a keyboard navigation cluster.

android:layerType Specifies the type of layer backing this view.

android:layoutDirection Defines the direction of layout drawing.

android:longClickable Defines whether this view reacts to long click events.

android:minHeight Defines the minimum height of the view.

android:minWidth Defines the minimum width of the view.

android:nextClusterForward Defines the next keyboard navigation cluster.

android:nextFocusDown Defines the next view to give focus to when the next focus is View.FOCUS_DOWN If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a RuntimeException will result when the reference is accessed.

android:nextFocusForward Defines the next view to give focus to when the next focus is View.FOCUS_FORWARD If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a RuntimeException will result when the reference is accessed.

android:nextFocusLeft Defines the next view to give focus to when the next focus is View.FOCUS_LEFT .

android:nextFocusRight Defines the next view to give focus to when the next focus is View.FOCUS_RIGHT If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a RuntimeException will result when the reference is accessed.

android:nextFocusUp Defines the next view to give focus to when the next focus is View.FOCUS_UP If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a RuntimeException will result when the reference is accessed.

android:onClick Name of the method in this View's context to invoke when the view is clicked.

android:outlineAmbientShadowColor Sets the color of the ambient shadow that is drawn when the view has a positive Z or elevation value.

android:outlineSpotShadowColor Sets the color of the spot shadow that is drawn when the view has a positive Z or elevation value.

android:padding Sets the padding, in pixels, of all four edges.

android:paddingBottom Sets the padding, in pixels, of the bottom edge; see R.attr.padding .

android:paddingEnd Sets the padding, in pixels, of the end edge; see R.attr.padding .

android:paddingHorizontal Sets the padding, in pixels, of the left and right edges; see R.attr.padding .

android:paddingLeft Sets the padding, in pixels, of the left edge; see R.attr.padding .

android:paddingRight Sets the padding, in pixels, of the right edge; see R.attr.padding .

android:paddingStart Sets the padding, in pixels, of the start edge; see R.attr.padding .

android:paddingTop Sets the padding, in pixels, of the top edge; see R.attr.padding .

android:paddingVertical Sets the padding, in pixels, of the top and bottom edges; see R.attr.padding .

android:requiresFadingEdge Defines which edges should be faded on scrolling.

android:rotation rotation of the view, in degrees.

android:rotationX rotation of the view around the x axis, in degrees.

android:rotationY rotation of the view around the y axis, in degrees.

android:saveEnabled If false, no state will be saved for this view when it is being frozen.

android:scaleX scale of the view in the x direction.

android:scaleY scale of the view in the y direction.

android:screenReaderFocusable Whether this view should be treated as a focusable unit by screen reader accessibility tools.

android:scrollIndicators Defines which scroll indicators should be displayed when the view can be scrolled.

android:scrollX The initial horizontal scroll offset, in pixels.

android:scrollY The initial vertical scroll offset, in pixels.

android:scrollbarAlwaysDrawHorizontalTrack Defines whether the horizontal scrollbar track should always be drawn.

android:scrollbarAlwaysDrawVerticalTrack Defines whether the vertical scrollbar track should always be drawn.

android:scrollbarDefaultDelayBeforeFade Defines the delay in milliseconds that a scrollbar waits before fade out.

android:scrollbarFadeDuration Defines the delay in milliseconds that a scrollbar takes to fade out.

android:scrollbarSize Sets the width of vertical scrollbars and height of horizontal scrollbars.

android:scrollbarStyle Controls the scrollbar style and position.

android:scrollbarThumbHorizontal Defines the horizontal scrollbar thumb drawable.

android:scrollbarThumbVertical Defines the vertical scrollbar thumb drawable.

android:scrollbarTrackHorizontal Defines the horizontal scrollbar track drawable.

android:scrollbarTrackVertical Defines the vertical scrollbar track drawable.

android:scrollbars Defines which scrollbars should be displayed on scrolling or not.

android:soundEffectsEnabled Boolean that controls whether a view should have sound effects enabled for events such as clicking and touching.

android:stateListAnimator Sets the state-based animator for the View.

android:tag Supply a tag for this view containing a String, to be retrieved later with View.getTag() or searched for with View.findViewWithTag() .

android:textAlignment Defines the alignment of the text.

android:textDirection Defines the direction of the text.

android:theme Specifies a theme override for a view.

android:tooltipText Defines text displayed in a small popup window on hover or long press.

android:transformPivotX x location of the pivot point around which the view will rotate and scale.

android:transformPivotY y location of the pivot point around which the view will rotate and scale.

android:transitionName Names a View such that it can be identified for Transitions.

android:translationX translation in x of the view.

android:translationY translation in y of the view.

android:translationZ translation in z of the view.

android:visibility Controls the initial visibility of the view.

Fields public static final Property<View, Float> ALPHA A Property wrapper around the alpha functionality handled by the View#setAlpha(float) and View#getAlpha() methods. protected static final int[] EMPTY_STATE_SET Indicates the view has no states set. protected static final int[] ENABLED_FOCUSED_SELECTED_STATE_SET Indicates the view is enabled, focused and selected. protected static final int[] ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET Indicates the view is enabled, focused, selected and its window has the focus. protected static final int[] ENABLED_FOCUSED_STATE_SET Indicates the view is enabled and has the focus. protected static final int[] ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET Indicates the view is enabled, focused and its window has the focus. protected static final int[] ENABLED_SELECTED_STATE_SET Indicates the view is enabled and selected. protected static final int[] ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET Indicates the view is enabled, selected and its window has the focus. protected static final int[] ENABLED_STATE_SET Indicates the view is enabled. protected static final int[] ENABLED_WINDOW_FOCUSED_STATE_SET Indicates the view is enabled and that its window has focus. protected static final int[] FOCUSED_SELECTED_STATE_SET Indicates the view is focused and selected. protected static final int[] FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET Indicates the view is focused, selected and its window has the focus. protected static final int[] FOCUSED_STATE_SET Indicates the view is focused. protected static final int[] FOCUSED_WINDOW_FOCUSED_STATE_SET Indicates the view has the focus and that its window has the focus. protected static final int[] PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET Indicates the view is pressed, enabled, focused and selected. protected static final int[] PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET Indicates the view is pressed, enabled, focused, selected and its window has the focus. protected static final int[] PRESSED_ENABLED_FOCUSED_STATE_SET Indicates the view is pressed, enabled and focused. protected static final int[] PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET Indicates the view is pressed, enabled, focused and its window has the focus. protected static final int[] PRESSED_ENABLED_SELECTED_STATE_SET Indicates the view is pressed, enabled and selected. protected static final int[] PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET Indicates the view is pressed, enabled, selected and its window has the focus. protected static final int[] PRESSED_ENABLED_STATE_SET Indicates the view is pressed and enabled. protected static final int[] PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET Indicates the view is pressed, enabled and its window has the focus. protected static final int[] PRESSED_FOCUSED_SELECTED_STATE_SET Indicates the view is pressed, focused and selected. protected static final int[] PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET Indicates the view is pressed, focused, selected and its window has the focus. protected static final int[] PRESSED_FOCUSED_STATE_SET Indicates the view is pressed and focused. protected static final int[] PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET Indicates the view is pressed, focused and its window has the focus. protected static final int[] PRESSED_SELECTED_STATE_SET Indicates the view is pressed and selected. protected static final int[] PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET Indicates the view is pressed, selected and its window has the focus. protected static final int[] PRESSED_STATE_SET Indicates the view is pressed. protected static final int[] PRESSED_WINDOW_FOCUSED_STATE_SET Indicates the view is pressed and its window has the focus. public static final Property<View, Float> ROTATION A Property wrapper around the rotation functionality handled by the View#setRotation(float) and View#getRotation() methods. public static final Property<View, Float> ROTATION_X A Property wrapper around the rotationX functionality handled by the View#setRotationX(float) and View#getRotationX() methods. public static final Property<View, Float> ROTATION_Y A Property wrapper around the rotationY functionality handled by the View#setRotationY(float) and View#getRotationY() methods. public static final Property<View, Float> SCALE_X A Property wrapper around the scaleX functionality handled by the View#setScaleX(float) and View#getScaleX() methods. public static final Property<View, Float> SCALE_Y A Property wrapper around the scaleY functionality handled by the View#setScaleY(float) and View#getScaleY() methods. protected static final int[] SELECTED_STATE_SET Indicates the view is selected. protected static final int[] SELECTED_WINDOW_FOCUSED_STATE_SET Indicates the view is selected and that its window has the focus. public static final Property<View, Float> TRANSLATION_X A Property wrapper around the translationX functionality handled by the View#setTranslationX(float) and View#getTranslationX() methods. public static final Property<View, Float> TRANSLATION_Y A Property wrapper around the translationY functionality handled by the View#setTranslationY(float) and View#getTranslationY() methods. public static final Property<View, Float> TRANSLATION_Z A Property wrapper around the translationZ functionality handled by the View#setTranslationZ(float) and View#getTranslationZ() methods. protected static final int[] WINDOW_FOCUSED_STATE_SET Indicates the view's window has focus. public static final Property<View, Float> X A Property wrapper around the x functionality handled by the View#setX(float) and View#getX() methods. public static final Property<View, Float> Y A Property wrapper around the y functionality handled by the View#setY(float) and View#getY() methods. public static final Property<View, Float> Z A Property wrapper around the z functionality handled by the View#setZ(float) and View#getZ() methods.

Public constructors View(Context context) Simple constructor to use when creating a view from code. View(Context context, AttributeSet attrs) Constructor that is called when inflating a view from XML. View(Context context, AttributeSet attrs, int defStyleAttr) Perform inflation from XML and apply a class-specific base style from a theme attribute. View(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) Perform inflation from XML and apply a class-specific base style from a theme attribute or style resource.

Inherited methods java.lang.Object From class Object clone() Creates and returns a copy of this object. boolean equals(Object obj) Indicates whether some other object is "equal to" this one. void finalize() Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. final Class<?> getClass() Returns the runtime class of this Object . int hashCode() Returns a hash code value for the object. final void notify() Wakes up a single thread that is waiting on this object's monitor. final void notifyAll() Wakes up all threads that are waiting on this object's monitor. String toString() Returns a string representation of the object. final void wait(long timeout, int nanos) Causes the current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed. final void wait(long timeout) Causes the current thread to wait until either another thread invokes the notify() method or the notifyAll() method for this object, or a specified amount of time has elapsed. final void wait() Causes the current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object. android.graphics.drawable.Drawable.Callback From interface abstract void invalidateDrawable(Drawable who) Called when the drawable needs to be redrawn. abstract void scheduleDrawable(Drawable who, Runnable what, long when) A Drawable can call this to schedule the next frame of its animation. abstract void unscheduleDrawable(Drawable who, Runnable what) A Drawable can call this to unschedule an action previously scheduled with scheduleDrawable(Drawable, Runnable, long) . android.view.KeyEvent.Callback From interface abstract boolean onKeyDown(int keyCode, KeyEvent event) Called when a key down event has occurred. abstract boolean onKeyLongPress(int keyCode, KeyEvent event) Called when a long press has occurred. abstract boolean onKeyMultiple(int keyCode, int count, KeyEvent event) Called when a user's interaction with an analog control, such as flinging a trackball, generates simulated down/up events for the same key multiple times in quick succession. abstract boolean onKeyUp(int keyCode, KeyEvent event) Called when a key up event has occurred. android.view.accessibility.AccessibilityEventSource From interface abstract void sendAccessibilityEvent(int eventType) Handles the request for sending an AccessibilityEvent given the event type. abstract void sendAccessibilityEventUnchecked(AccessibilityEvent event) Handles the request for sending an AccessibilityEvent .

XML attributes

android:accessibilityHeading

Whether or not this view is a heading for accessibility purposes.

May be a boolean value, such as " true " or " false ".

Related methods:

android:accessibilityLiveRegion

Indicates to accessibility services whether the user should be notified when this view changes.

May be an integer value, such as " 100 ".

Must be one of the following constant values.

Constant Value Description assertive 2 Accessibility services should interrupt ongoing speech to immediately announce changes to this view. none 0 Accessibility services should not announce changes to this view. polite 1 Accessibility services should announce changes to this view.

Related methods:

android:accessibilityPaneTitle

The title this view should present to accessibility as a pane title. See View.setAccessibilityPaneTitle(CharSequence)

May be a string value, using '\\;' to escape characters such as '\

' or '\\uxxxx' for a unicode character;

Related methods:

android:accessibilityTraversalAfter

Sets the id of a view after which this one is visited in accessibility traversal. A screen-reader must visit the content of the other view before the content of this one.

May be an integer value, such as " 100 ".

Related methods:

android:accessibilityTraversalBefore

Sets the id of a view before which this one is visited in accessibility traversal. A screen-reader must visit the content of this view before the content of the one it precedes.

May be an integer value, such as " 100 ".

Related methods:

android:alpha

alpha property of the view, as a value between 0 (completely transparent) and 1 (completely opaque).

May be a floating point value, such as " 1.2 ".

Related methods:

android:autofillHints

Describes the content of a view so that a autofill service can fill in the appropriate data. Multiple hints can be combined in a comma separated list or an array of strings to mean e.g. emailAddress or postalAddress.

May be a reference to another resource, in the form " @[+][package:]type/name " or a theme attribute in the form " ?[package:]type/name ".

May be a string value, using '\\;' to escape characters such as '\

' or '\\uxxxx' for a unicode character;

Related methods:

android:autofilledHighlight

Drawable to be drawn over the view to mark it as autofilled

May be a reference to another resource, in the form " @[+][package:]type/name " or a theme attribute in the form " ?[package:]type/name ".

Related methods:

android:background

A drawable to use as the background. This can be either a reference to a full drawable resource (such as a PNG image, 9-patch, XML state list description, etc), or a solid color such as "#ff000000" (black).

May be a reference to another resource, in the form " @[+][package:]type/name " or a theme attribute in the form " ?[package:]type/name ".

May be a color value, in the form of " #rgb ", " #argb ", " #rrggbb ", or " #aarrggbb ".

Related methods:

android:backgroundTint

Tint to apply to the background.

May be a color value, in the form of " #rgb ", " #argb ", " #rrggbb ", or " #aarrggbb ".

Related methods:

android:backgroundTintMode

Blending mode used to apply the background tint.

Must be one of the following constant values.

Constant Value Description add 10 Combines the tint and drawable color and alpha channels, clamping the result to valid color values. Saturate(S + D) multiply e Multiplies the color and alpha channels of the drawable with those of the tint. [Sa * Da, Sc * Dc] screen f [Sa + Da - Sa * Da, Sc + Dc - Sc * Dc] src_atop 9 The tint is drawn above the drawable, but with the drawable?s alpha channel masking the result. [Da, Sc * Da + (1 - Sa) * Dc] src_in 5 The tint is masked by the alpha channel of the drawable. The drawable?s color channels are thrown out. [Sa * Da, Sc * Da] src_over 3 The tint is drawn on top of the drawable. [Sa + (1 - Sa)*Da, Rc = Sc + (1 - Sa)*Dc]

Related methods:

android:clickable

Defines whether this view reacts to click events.

May be a boolean value, such as " true " or " false ".

Related methods:

android:contentDescription

Defines text that briefly describes content of the view. This property is used primarily for accessibility. Since some views do not have textual representation this attribute can be used for providing such.

May be a string value, using '\\;' to escape characters such as '\

' or '\\uxxxx' for a unicode character;

Related methods:

android:contextClickable

Defines whether this view reacts to context click events.

May be a boolean value, such as " true " or " false ".

Related methods:

android:defaultFocusHighlightEnabled

Whether this View should use a default focus highlight when it gets focused but doesn't have R.attr.state_focused defined in its background.

May be a boolean value, such as " true " or " false ".

Related methods:

android:drawingCacheQuality

Defines the quality of translucent drawing caches. This property is used only when the drawing cache is enabled and translucent. The default value is auto. Deprecated: The view drawing cache was largely made obsolete with the introduction of hardware-accelerated rendering in API 11.

Must be one of the following constant values.

Constant Value Description auto 0 Lets the framework decide what quality level should be used for the drawing cache. Deprecated: The view drawing cache was largely made obsolete with the introduction of hardware-accelerated rendering in API 11. high 2 High quality. When set to high quality, the drawing cache uses a higher color depth but uses more memory. Deprecated: The view drawing cache was largely made obsolete with the introduction of hardware-accelerated rendering in API 11. low 1 Low quality. When set to low quality, the drawing cache uses a lower color depth, thus losing precision in rendering gradients, but uses less memory. Deprecated: The view drawing cache was largely made obsolete with the introduction of hardware-accelerated rendering in API 11.

Related methods:

android:duplicateParentState

When this attribute is set to true, the view gets its drawable state (focused, pressed, etc.) from its direct parent rather than from itself.

May be a boolean value, such as " true " or " false ".

android:elevation

base z depth of the view.

May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

Related methods:

android:fadeScrollbars

Defines whether to fade out scrollbars when they are not in use.

May be a boolean value, such as " true " or " false ".

Related methods:

android:fadingEdgeLength

Defines the length of the fading edges.

May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

Related methods:

android:filterTouchesWhenObscured

Specifies whether to filter touches when the view's window is obscured by another visible window. When set to true, the view will not receive touches whenever a toast, dialog or other window appears above the view's window. Refer to the View security documentation for more details.

May be a boolean value, such as " true " or " false ".

Related methods:

android:fitsSystemWindows

Boolean internal attribute to adjust view layout based on system windows such as the status bar. If true, adjusts the padding of this view to leave space for the system windows. Will only take effect if this view is in a non-embedded activity.

May be a boolean value, such as " true " or " false ".

Related methods:

android:focusable

Controls whether a view can take focus. By default, this is "auto" which lets the framework determine whether a user can move focus to a view. By setting this attribute to true the view is allowed to take focus. By setting it to "false" the view will not take focus. This value does not impact the behavior of directly calling View.requestFocus() , which will always request focus regardless of this view. It only impacts where focus navigation will try to move focus.

May be a boolean value, such as " true " or " false ".

Must be one of the following constant values.

Constant Value Description auto 10

Related methods:

android:focusableInTouchMode

Boolean that controls whether a view can take focus while in touch mode. If this is true for a view, that view can gain focus when clicked on, and can keep focus if another view is clicked on that doesn't have this attribute set to true.

May be a boolean value, such as " true " or " false ".

Related methods:

android:focusedByDefault

Whether this view is a default-focus view. Only one view per keyboard navigation cluster can have this attribute set to true. See View.setFocusedByDefault(boolean) .

May be a boolean value, such as " true " or " false ".

Related methods:

android:forceHasOverlappingRendering

Whether this view has elements that may overlap when drawn. See View.forceHasOverlappingRendering(boolean) .

May be a boolean value, such as " true " or " false ".

Related methods:

android:foreground

Defines the drawable to draw over the content. This can be used as an overlay. The foreground drawable participates in the padding of the content if the gravity is set to fill.

May be a reference to another resource, in the form " @[+][package:]type/name " or a theme attribute in the form " ?[package:]type/name ".

May be a color value, in the form of " #rgb ", " #argb ", " #rrggbb ", or " #aarrggbb ".

Related methods:

android:foregroundGravity

Defines the gravity to apply to the foreground drawable. The gravity defaults to fill.

Must be one or more (separated by '|') of the following constant values.

Constant Value Description bottom 50 Push object to the bottom of its container, not changing its size. center 11 Place the object in the center of its container in both the vertical and horizontal axis, not changing its size. center_horizontal 1 Place object in the horizontal center of its container, not changing its size. center_vertical 10 Place object in the vertical center of its container, not changing its size. clip_horizontal 8 Additional option that can be set to have the left and/or right edges of the child clipped to its container's bounds. The clip will be based on the horizontal gravity: a left gravity will clip the right edge, a right gravity will clip the left edge, and neither will clip both edges. clip_vertical 80 Additional option that can be set to have the top and/or bottom edges of the child clipped to its container's bounds. The clip will be based on the vertical gravity: a top gravity will clip the bottom edge, a bottom gravity will clip the top edge, and neither will clip both edges. fill 77 Grow the horizontal and vertical size of the object if needed so it completely fills its container. fill_horizontal 7 Grow the horizontal size of the object if needed so it completely fills its container. fill_vertical 70 Grow the vertical size of the object if needed so it completely fills its container. left 3 Push object to the left of its container, not changing its size. right 5 Push object to the right of its container, not changing its size. top 30 Push object to the top of its container, not changing its size.

Related methods:

android:foregroundTint

Tint to apply to the foreground.

May be a color value, in the form of " #rgb ", " #argb ", " #rrggbb ", or " #aarrggbb ".

Related methods:

android:foregroundTintMode

Blending mode used to apply the foreground tint.

Must be one of the following constant values.

Constant Value Description add 10 Combines the tint and drawable color and alpha channels, clamping the result to valid color values. Saturate(S + D) multiply e Multiplies the color and alpha channels of the drawable with those of the tint. [Sa * Da, Sc * Dc] screen f [Sa + Da - Sa * Da, Sc + Dc - Sc * Dc] src_atop 9 The tint is drawn above the drawable, but with the drawable?s alpha channel masking the result. [Da, Sc * Da + (1 - Sa) * Dc] src_in 5 The tint is masked by the alpha channel of the drawable. The drawable?s color channels are thrown out. [Sa * Da, Sc * Da] src_over 3 The tint is drawn on top of the drawable. [Sa + (1 - Sa)*Da, Rc = Sc + (1 - Sa)*Dc]

Related methods:

android:hapticFeedbackEnabled

Boolean that controls whether a view should have haptic feedback enabled for events such as long presses.

May be a boolean value, such as " true " or " false ".

Related methods:

android:id

Supply an identifier name for this view, to later retrieve it with View.findViewById() or Activity.findViewById() . This must be a resource reference; typically you set this using the @+ syntax to create a new ID resources. For example: android:id="@+id/my_id" which allows you to later retrieve the view with findViewById(R.id.my_id) .

May be a reference to another resource, in the form " @[+][package:]type/name " or a theme attribute in the form " ?[package:]type/name ".

Related methods:

android:importantForAccessibility

Describes whether or not this view is important for accessibility. If it is important, the view fires accessibility events and is reported to accessibility services that query the screen. Note: While not recommended, an accessibility service may decide to ignore this attribute and operate on all views in the view tree.

May be an integer value, such as " 100 ".

Must be one of the following constant values.

Constant Value Description auto 0 The system determines whether the view is important for accessibility - default (recommended). no 2 The view is not important for accessibility. noHideDescendants 4 The view is not important for accessibility, nor are any of its descendant views. yes 1 The view is important for accessibility.

Related methods:

android:importantForAutofill

Hints the Android System whether the view node associated with this View should be included in a view structure used for autofill purposes.

Must be one or more (separated by '|') of the following constant values.

Constant Value Description auto 0 Let the Android System use its heuristics to determine if the view is important for autofill. no 2 Hint the Android System that this view is *not* important for autofill, but its children (if any) will be traversed.. noExcludeDescendants 8 Hint the Android System that this view is *not* important for autofill, and its children (if any) will not be traversed. yes 1 Hint the Android System that this view is important for autofill, and its children (if any) will be traversed.. yesExcludeDescendants 4 Hint the Android System that this view is important for autofill, but its children (if any) will not be traversed.

Related methods:

android:importantForContentCapture

Hints the Android System whether the view node associated with this View should be use for content capture purposes.

Must be one or more (separated by '|') of the following constant values.

Constant Value Description auto 0 Let the Android System use its heuristics to determine if the view is important for content capture. no 2 Hint the Android System that this view is *not* important for content capture, but its children (if any) will be traversed.. noExcludeDescendants 8 Hint the Android System that this view is *not* important for content capture, and its children (if any) will not be traversed. yes 1 Hint the Android System that this view is important for content capture, and its children (if any) will be traversed.. yesExcludeDescendants 4 Hint the Android System that this view is important for content capture, but its children (if any) will not be traversed.

Related methods:

android:isScrollContainer

Set this if the view will serve as a scrolling container, meaning that it can be resized to shrink its overall window so that there will be space for an input method. If not set, the default value will be true if "scrollbars" has the vertical scrollbar set, else it will be false.

May be a boolean value, such as " true " or " false ".

Related methods:

android:keepScreenOn

Controls whether the view's window should keep the screen on while visible.

May be a boolean value, such as " true " or " false ".

Related methods:

android:keyboardNavigationCluster

Whether this view is a root of a keyboard navigation cluster. See View.setKeyboardNavigationCluster(boolean) .

May be a boolean value, such as " true " or " false ".

Related methods:

android:layerType

Specifies the type of layer backing this view. The default value is none. Refer to View.setLayerType(int, android.graphics.Paint) for more information.

Must be one of the following constant values.

Constant Value Description hardware 2 Use a hardware layer. Refer to View.setLayerType(int, android.graphics.Paint) for more information. none 0 Don't use a layer. software 1 Use a software layer. Refer to View.setLayerType(int, android.graphics.Paint) for more information.

Related methods:

android:layoutDirection

Defines the direction of layout drawing. This typically is associated with writing direction of the language script used. The possible values are "ltr" for Left-to-Right, "rtl" for Right-to-Left, "locale", and "inherit" from parent view. If there is nothing to inherit, "locale" is used. "locale" falls back to "en-US". "ltr" is the direction used in "en-US". The default for this attribute is "inherit".

Must be one of the following constant values.

Constant Value Description inherit 2 Inherit from parent. locale 3 Locale. ltr 0 Left-to-Right. rtl 1 Right-to-Left.

Related methods:

android:longClickable

Defines whether this view reacts to long click events.

May be a boolean value, such as " true " or " false ".

Related methods:

android:minHeight

Defines the minimum height of the view. It is not guaranteed the view will be able to achieve this minimum height (for example, if its parent layout constrains it with less available height).

May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

Related methods:

android:minWidth

Defines the minimum width of the view. It is not guaranteed the view will be able to achieve this minimum width (for example, if its parent layout constrains it with less available width).

May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

Related methods:

android:nextClusterForward

Defines the next keyboard navigation cluster. If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a RuntimeException will result when the reference is accessed.

May be a reference to another resource, in the form " @[+][package:]type/name " or a theme attribute in the form " ?[package:]type/name ".

Related methods:

android:nextFocusDown

Defines the next view to give focus to when the next focus is View.FOCUS_DOWN If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a RuntimeException will result when the reference is accessed.

May be a reference to another resource, in the form " @[+][package:]type/name " or a theme attribute in the form " ?[package:]type/name ".

Related methods:

android:nextFocusForward

Defines the next view to give focus to when the next focus is View.FOCUS_FORWARD If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a RuntimeException will result when the reference is accessed.

May be a reference to another resource, in the form " @[+][package:]type/name " or a theme attribute in the form " ?[package:]type/name ".

Related methods:

android:nextFocusLeft

Defines the next view to give focus to when the next focus is View.FOCUS_LEFT . If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a RuntimeException will result when the reference is accessed.

May be a reference to another resource, in the form " @[+][package:]type/name " or a theme attribute in the form " ?[package:]type/name ".

Related methods:

android:nextFocusRight

Defines the next view to give focus to when the next focus is View.FOCUS_RIGHT If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a RuntimeException will result when the reference is accessed.

May be a reference to another resource, in the form " @[+][package:]type/name " or a theme attribute in the form " ?[package:]type/name ".

Related methods:

android:nextFocusUp

Defines the next view to give focus to when the next focus is View.FOCUS_UP If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a RuntimeException will result when the reference is accessed.

May be a reference to another resource, in the form " @[+][package:]type/name " or a theme attribute in the form " ?[package:]type/name ".

Related methods:

android:onClick

Name of the method in this View's context to invoke when the view is clicked. This name must correspond to a public method that takes exactly one parameter of type View. For instance, if you specify android:onClick="sayHello" , you must declare a public void sayHello(View v) method of your context (typically, your Activity).

May be a string value, using '\\;' to escape characters such as '\

' or '\\uxxxx' for a unicode character;

android:outlineAmbientShadowColor

Sets the color of the ambient shadow that is drawn when the view has a positive Z or elevation value.

By default the shadow color is black. Generally, this color will be opaque so the intensity of the shadow is consistent between different views with different colors.

The opacity of the final ambient shadow is a function of the shadow caster height, the alpha channel of the outlineAmbientShadowColor (typically opaque), and the R.attr.ambientShadowAlpha theme attribute.

May be a color value, in the form of " #rgb ", " #argb ", " #rrggbb ", or " #aarrggbb ".

Related methods:

android:outlineSpotShadowColor

Sets the color of the spot shadow that is drawn when the view has a positive Z or elevation value.

By default the shadow color is black. Generally, this color will be opaque so the intensity of the shadow is consistent between different views with different colors.

The opacity of the final spot shadow is a function of the shadow caster height, the alpha channel of the outlineSpotShadowColor (typically opaque), and the R.attr.spotShadowAlpha theme attribute.

May be a color value, in the form of " #rgb ", " #argb ", " #rrggbb ", or " #aarrggbb ".

Related methods:

android:padding

Sets the padding, in pixels, of all four edges. Padding is defined as space between the edges of the view and the view's content. This value will take precedence over any of the edge-specific values (paddingLeft, paddingTop, paddingRight, paddingBottom, paddingHorizontal and paddingVertical), but will not override paddingStart or paddingEnd, if set. A view's size will include its padding. If a R.attr.background is provided, the padding will initially be set to that (0 if the drawable does not have padding). Explicitly setting a padding value will override the corresponding padding found in the background.

May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

Related methods:

android:paddingBottom

Sets the padding, in pixels, of the bottom edge; see R.attr.padding .

May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

Related methods:

android:paddingEnd

Sets the padding, in pixels, of the end edge; see R.attr.padding .

May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

Related methods:

android:paddingHorizontal

Sets the padding, in pixels, of the left and right edges; see R.attr.padding . This value will take precedence over paddingLeft and paddingRight, but not paddingStart or paddingEnd (if set).

May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

android:paddingLeft

Sets the padding, in pixels, of the left edge; see R.attr.padding .

May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

Related methods:

android:paddingRight

Sets the padding, in pixels, of the right edge; see R.attr.padding .

May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

Related methods:

android:paddingStart

Sets the padding, in pixels, of the start edge; see R.attr.padding .

May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

Related methods:

android:paddingTop

Sets the padding, in pixels, of the top edge; see R.attr.padding .

May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

Related methods:

android:paddingVertical

Sets the padding, in pixels, of the top and bottom edges; see R.attr.padding . This value will take precedence over paddingTop and paddingBottom, if set.

May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

android:requiresFadingEdge

Defines which edges should be faded on scrolling.

Must be one or more (separated by '|') of the following constant values.

Constant Value Description horizontal 1000 Fades horizontal edges only. none 0 No edge is faded. vertical 2000 Fades vertical edges only.

Related methods:

android:rotation

rotation of the view, in degrees.

May be a floating point value, such as " 1.2 ".

Related methods:

android:rotationX

rotation of the view around the x axis, in degrees.

May be a floating point value, such as " 1.2 ".

Related methods:

android:rotationY

rotation of the view around the y axis, in degrees.

May be a floating point value, such as " 1.2 ".

Related methods:

android:saveEnabled

If false, no state will be saved for this view when it is being frozen. The default is true, allowing the view to be saved (however it also must have an ID assigned to it for its state to be saved). Setting this to false only disables the state for this view, not for its children which may still be saved.

May be a boolean value, such as " true " or " false ".

Related methods:

android:scaleX

scale of the view in the x direction.

May be a floating point value, such as " 1.2 ".

Related methods:

android:scaleY

scale of the view in the y direction.

May be a floating point value, such as " 1.2 ".

Related methods:

android:screenReaderFocusable

Whether this view should be treated as a focusable unit by screen reader accessibility tools. See View.setScreenReaderFocusable(boolean) . The default value, false , leaves the screen reader to consider other signals, such as focusability or the presence of text, to decide what it focus.

May be a boolean value, such as " true " or " false ".

Related methods:

android:scrollIndicators

Defines which scroll indicators should be displayed when the view can be scrolled. Multiple values may be combined using logical OR, for example "top|bottom".

Must be one or more (separated by '|') of the following constant values.

Constant Value Description bottom 2 Displays bottom scroll indicator when vew can be scrolled down. end 20 Displays right scroll indicator when vew can be scrolled in the end direction. left 4 Displays left scroll indicator when vew can be scrolled left. none 0 No scroll indicators are displayed. right 8 Displays right scroll indicator when vew can be scrolled right. start 10 Displays right scroll indicator when vew can be scrolled in the start direction. top 1 Displays top scroll indicator when view can be scrolled up.

Related methods:

android:scrollX

The initial horizontal scroll offset, in pixels.

May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

android:scrollY

The initial vertical scroll offset, in pixels.

May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

android:scrollbarAlwaysDrawHorizontalTrack

Defines whether the horizontal scrollbar track should always be drawn.

May be a boolean value, such as " true " or " false ".

android:scrollbarAlwaysDrawVerticalTrack

Defines whether the vertical scrollbar track should always be drawn.

May be a boolean value, such as " true " or " false ".

android:scrollbarDefaultDelayBeforeFade

Defines the delay in milliseconds that a scrollbar waits before fade out.

May be an integer value, such as " 100 ".

Related methods:

android:scrollbarFadeDuration

Defines the delay in milliseconds that a scrollbar takes to fade out.

May be an integer value, such as " 100 ".

Related methods:

android:scrollbarSize

Sets the width of vertical scrollbars and height of horizontal scrollbars.

May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

Related methods:

android:scrollbarStyle

Controls the scrollbar style and position. The scrollbars can be overlaid or inset. When inset, they add to the padding of the view. And the scrollbars can be drawn inside the padding area or on the edge of the view. For example, if a view has a background drawable and you want to draw the scrollbars inside the padding specified by the drawable, you can use insideOverlay or insideInset. If you want them to appear at the edge of the view, ignoring the padding, then you can use outsideOverlay or outsideInset.

Must be one of the following constant values.

Constant Value Description insideInset 1000000 Inside the padding and inset. insideOverlay 0 Inside the padding and overlaid. outsideInset 3000000 Edge of the view and inset. outsideOverlay 2000000 Edge of the view and overlaid.

Related methods:

android:scrollbarThumbHorizontal

Defines the horizontal scrollbar thumb drawable.

May be a reference to another resource, in the form " @[+][package:]type/name " or a theme attribute in the form " ?[package:]type/name ".

Related methods:

android:scrollbarThumbVertical

Defines the vertical scrollbar thumb drawable.

May be a reference to another resource, in the form " @[+][package:]type/name " or a theme attribute in the form " ?[package:]type/name ".

Related methods:

android:scrollbarTrackHorizontal

Defines the horizontal scrollbar track drawable.

May be a reference to another resource, in the form " @[+][package:]type/name " or a theme attribute in the form " ?[package:]type/name ".

Related methods:

android:scrollbarTrackVertical

Defines the vertical scrollbar track drawable.

May be a reference to another resource, in the form " @[+][package:]type/name " or a theme attribute in the form " ?[package:]type/name ".

Related methods:

android:scrollbars

Defines which scrollbars should be displayed on scrolling or not.

Must be one or more (separated by '|') of the following constant values.

Constant Value Description horizontal 100 Displays horizontal scrollbar only. none 0 No scrollbar is displayed. vertical 200 Displays vertical scrollbar only.

android:soundEffectsEnabled

Boolean that controls whether a view should have sound effects enabled for events such as clicking and touching.

May be a boolean value, such as " true " or " false ".

Related methods:

android:stateListAnimator

Sets the state-based animator for the View.

May be a reference to another resource, in the form " @[+][package:]type/name " or a theme attribute in the form " ?[package:]type/name ".

android:tag

Supply a tag for this view containing a String, to be retrieved later with View.getTag() or searched for with View.findViewWithTag() . It is generally preferable to use IDs (through the android:id attribute) instead of tags because they are faster and allow for compile-time type checking.

May be a string value, using '\\;' to escape characters such as '\

' or '\\uxxxx' for a unicode character;

android:textAlignment

Defines the alignment of the text.

May be an integer value, such as " 100 ".

Must be one of the following constant values.

Constant Value Description center 4 Center the paragraph, for example: ALIGN_CENTER. gravity 1 Default for the root view. The gravity determines the alignment, ALIGN_NORMAL, ALIGN_CENTER, or ALIGN_OPPOSITE, which are relative to each paragraph?s text direction. inherit 0 Default. textEnd 3 Align to the end of the paragraph, for example: ALIGN_OPPOSITE. textStart 2 Align to the start of the paragraph, for example: ALIGN_NORMAL. viewEnd 6 Align to the end of the view, which is ALIGN_RIGHT if the view?s resolved layoutDirection is LTR, and ALIGN_LEFT otherwise. viewStart 5 Align to the start of the view, which is ALIGN_LEFT if the view?s resolved layoutDirection is LTR, and ALIGN_RIGHT otherwise.

Related methods:

android:textDirection

Defines the direction of the text.

May be an integer value, such as " 100 ".

Must be one of the following constant values.

Constant Value Description anyRtl 2 The paragraph direction is RTL if it contains any strong RTL character, otherwise it is LTR if it contains any strong LTR characters. If there are neither, the paragraph direction is the view?s resolved layout direction. firstStrong 1 Default for the root view. The first strong directional character determines the paragraph direction. If there is no strong directional character, the paragraph direction is the view?s resolved layout direction. firstStrongLtr 6 The first strong directional character determines the paragraph direction. If there is no strong directional character, the paragraph direction is LTR. firstStrongRtl 7 The first strong directional character determines the paragraph direction. If there is no strong directional character, the paragraph direction is RTL. inherit 0 Default. locale 5 The paragraph direction is coming from the system Locale. ltr 3 The paragraph direction is left to right. rtl 4 The paragraph direction is right to left.

Related methods:

android:theme

Specifies a theme override for a view. When a theme override is set, the view will be inflated using a Context themed with the specified resource. During XML inflation, any child views under the view with a theme override will inherit the themed context.

May be a reference to another resource, in the form " @[+][package:]type/name " or a theme attribute in the form " ?[package:]type/name ".

android:tooltipText

Defines text displayed in a small popup window on hover or long press.

May be a string value, using '\\;' to escape characters such as '\

' or '\\uxxxx' for a unicode character;

Related methods:

android:transformPivotX

x location of the pivot point around which the view will rotate and scale. This xml attribute sets the pivotX property of the View.

May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

Related methods:

android:transformPivotY

y location of the pivot point around which the view will rotate and scale. This xml attribute sets the pivotY property of the View.

May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

Related methods:

android:transitionName

Names a View such that it can be identified for Transitions. Names should be unique in the View hierarchy.

May be a string value, using '\\;' to escape characters such as '\

' or '\\uxxxx' for a unicode character;

android:translationX

translation in x of the view. This value is added post-layout to the left property of the view, which is set by its layout.

May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

Related methods:

android:translationY

translation in y of the view. This value is added post-layout to the top property of the view, which is set by its layout.

May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

Related methods:

android:translationZ

translation in z of the view. This value is added to its elevation.

May be a dimension value, which is a floating point number appended with a unit such as " 14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

Related methods:

android:visibility

Controls the initial visibility of the view.

Must be one of the following constant values.

Constant Value Description gone 2 Completely hidden, as if the view had not been added. invisible 1 Not displayed, but taken into account during layout (space is left for it). visible 0 Visible on screen; the default value.

Related methods:

Constants

ACCESSIBILITY_LIVE_REGION_ASSERTIVE Added in API level 19 public static final int ACCESSIBILITY_LIVE_REGION_ASSERTIVE Live region mode specifying that accessibility services should interrupt ongoing speech to immediately announce changes to this view. Use with setAccessibilityLiveRegion(int) . Constant Value: 2 (0x00000002)

ACCESSIBILITY_LIVE_REGION_NONE Added in API level 19 public static final int ACCESSIBILITY_LIVE_REGION_NONE Live region mode specifying that accessibility services should not automatically announce changes to this view. This is the default live region mode for most views. Use with setAccessibilityLiveRegion(int) . Constant Value: 0 (0x00000000)

ACCESSIBILITY_LIVE_REGION_POLITE Added in API level 19 public static final int ACCESSIBILITY_LIVE_REGION_POLITE Live region mode specifying that accessibility services should announce changes to this view. Use with setAccessibilityLiveRegion(int) . Constant Value: 1 (0x00000001)

AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS Added in API level 26 public static final int AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS Flag requesting you to add views that are marked as not important for autofill (see setImportantForAutofill(int) ) to a ViewStructure . Constant Value: 1 (0x00000001)

Added in API level 26 public static final String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE Hint indicating that this view can be autofilled with a credit card expiration date. It should be used when the credit card expiration date is represented by just one view; if it is represented by more than one (for example, one view for the month and another view for the year), then each of these views should use the hint specific for the unit ( AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY , AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH , or AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR ). Can be used with either setAutofillHints(java.lang.String[]) or android:autofillHint (in which case the value should be .AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE ). When annotating a view with this hint, it's recommended to use a date autofill value to avoid ambiguity when the autofill service provides a value for it. To understand why a value can be ambiguous, consider "April of 2020", which could be represented as either of the following options: "04/2020"

"4/2020"

"2020/04"

"2020/4"

"April/2020"

"Apr/2020" You define a date autofill value for the view by overriding the following methods: getAutofillType() to return AUTOFILL_TYPE_DATE . getAutofillValue() to return a AutofillValue#forDate(long) . autofill(android.view.autofill.AutofillValue) to expect a data autofillvalue. See setAutofillHints(java.lang.String) for more info about autofill hints. Constant Value: "creditCardExpirationDate"

AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY Added in API level 26 public static final String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY Hint indicating that this view can be autofilled with a credit card expiration day. Can be used with either setAutofillHints(java.lang.String[]) or android:autofillHint (in which case the value should be .AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY ). See setAutofillHints(java.lang.String) for more info about autofill hints. Constant Value: "creditCardExpirationDay"

AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH Added in API level 26 public static final String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH Hint indicating that this view can be autofilled with a credit card expiration month. Can be used with either setAutofillHints(java.lang.String[]) or android:autofillHint (in which case the value should be .AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH ). When annotating a view with this hint, it's recommended to use a text autofill value whose value is the numerical representation of the month, starting on 1 to avoid ambiguity when the autofill service provides a value for it. To understand why a value can be ambiguous, consider "January", which could be represented as either of "1" : recommended way.

: recommended way. "0" : if following the Calendar#MONTH convention.

: if following the convention. "January" : full name, in English.

: full name, in English. "jan" : abbreviated name, in English.

: abbreviated name, in English. "Janeiro" : full name, in another language. Another recommended approach is to use a date autofill value - see AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE for more details. See setAutofillHints(java.lang.String) for more info about autofill hints. Constant Value: "creditCardExpirationMonth"

AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR Added in API level 26 public static final String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR Hint indicating that this view can be autofilled with a credit card expiration year. Can be used with either setAutofillHints(java.lang.String[]) or android:autofillHint (in which case the value should be .AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR ). See setAutofillHints(java.lang.String) for more info about autofill hints. Constant Value: "creditCardExpirationYear"

AUTOFILL_HINT_CREDIT_CARD_NUMBER Added in API level 26 public static final String AUTOFILL_HINT_CREDIT_CARD_NUMBER Hint indicating that this view can be autofilled with a credit card number. Can be used with either setAutofillHints(java.lang.String[]) or android:autofillHint (in which case the value should be .AUTOFILL_HINT_CREDIT_CARD_NUMBER ). See setAutofillHints(java.lang.String) for more info about autofill hints. Constant Value: "creditCardNumber"

AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE Added in API level 26 public static final String AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE Hint indicating that this view can be autofilled with a credit card security code. Can be used with either setAutofillHints(java.lang.String[]) or android:autofillHint (in which case the value should be .AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE ). See setAutofillHints(java.lang.String) for more info about autofill hints. Constant Value: "creditCardSecurityCode"

AUTOFILL_HINT_EMAIL_ADDRESS Added in API level 26 public static final String AUTOFILL_HINT_EMAIL_ADDRESS Hint indicating that this view can be autofilled with an email address. Can be used with either setAutofillHints(java.lang.String[]) or android:autofillHint (in which case the value should be .AUTOFILL_HINT_EMAIL_ADDRESS ). See setAutofillHints(java.lang.String) for more info about autofill hints. Constant Value: "emailAddress"

AUTOFILL_HINT_NAME Added in API level 26 public static final String AUTOFILL_HINT_NAME Hint indicating that this view can be autofilled with a user's real name. Can be used with either setAutofillHints(java.lang.String[]) or android:autofillHint (in which case the value should be .AUTOFILL_HINT_NAME ). See setAutofillHints(java.lang.String) for more info about autofill hints. Constant Value: "name"

AUTOFILL_HINT_PASSWORD Added in API level 26 public static final String AUTOFILL_HINT_PASSWORD Hint indicating that this view can be autofilled with a password. Can be used with either setAutofillHints(java.lang.String[]) or android:autofillHint (in which case the value should be .AUTOFILL_HINT_PASSWORD ). See setAutofillHints(java.lang.String) for more info about autofill hints. Constant Value: "password"

AUTOFILL_HINT_PHONE Added in API level 26 public static final String AUTOFILL_HINT_PHONE Hint indicating that this view can be autofilled with a phone number. Can be used with either setAutofillHints(java.lang.String[]) or android:autofillHint (in which case the value should be .AUTOFILL_HINT_PHONE ). See setAutofillHints(java.lang.String) for more info about autofill hints. Constant Value: "phone"

AUTOFILL_HINT_POSTAL_ADDRESS Added in API level 26 public static final String AUTOFILL_HINT_POSTAL_ADDRESS Hint indicating that this view can be autofilled with a postal address. Can be used with either setAutofillHints(java.lang.String[]) or android:autofillHint (in which case the value should be .AUTOFILL_HINT_POSTAL_ADDRESS ). See setAutofillHints(java.lang.String) for more info about autofill hints. Constant Value: "postalAddress"

AUTOFILL_HINT_POSTAL_CODE Added in API level 26 public static final String AUTOFILL_HINT_POSTAL_CODE Hint indicating that this view can be autofilled with a postal code. Can be used with either setAutofillHints(java.lang.String[]) or android:autofillHint (in which case the value should be .AUTOFILL_HINT_POSTAL_CODE ). See setAutofillHints(java.lang.String) for more info about autofill hints. Constant Value: "postalCode"

AUTOFILL_HINT_USERNAME Added in API level 26 public static final String AUTOFILL_HINT_USERNAME Hint indicating that this view can be autofilled with a username. Can be used with either setAutofillHints(java.lang.String[]) or android:autofillHint (in which case the value should be .AUTOFILL_HINT_USERNAME ). See setAutofillHints(java.lang.String) for more info about autofill hints. Constant Value: "username"

Added in API level 26 public static final int AUTOFILL_TYPE_DATE 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 Date.getTime() . AutofillValue instances for autofilling a View can be obtained through AutofillValue#forDate(long) , and the values passed to autofill a View can be fetched through AutofillValue#getDateValue() . See also: getAutofillType() Constant Value: 4 (0x00000004)

AUTOFILL_TYPE_LIST Added in API level 26 public static final int AUTOFILL_TYPE_LIST Autofill type for a selection list field, which is filled by an int representing the element index inside the list (starting at 0 ). AutofillValue instances for autofilling a View can be obtained through AutofillValue#forList(int) , and the value passed to autofill a View can be fetched through AutofillValue#getListValue() . The available options in the selection list are typically provided by AssistStructure.ViewNode.getAutofillOptions() . See also: getAutofillType() Constant Value: 3 (0x00000003)

AUTOFILL_TYPE_NONE Added in API level 26 public static final int AUTOFILL_TYPE_NONE Autofill type for views that cannot be autofilled. Typically used when the view is read-only; for example, a text label. See also: getAutofillType() Constant Value: 0 (0x00000000)

AUTOFILL_TYPE_TEXT Added in API level 26 public static final int AUTOFILL_TYPE_TEXT Autofill type for a text field, which is filled by a CharSequence . AutofillValue instances for autofilling a View can be obtained through AutofillValue#forText(CharSequence) , and the value passed to autofill a View can be fetched through AutofillValue#getTextValue() . See also: getAutofillType() Constant Value: 1 (0x00000001)

AUTOFILL_TYPE_TOGGLE Added in API level 26 public static final int AUTOFILL_TYPE_TOGGLE Autofill type for a togglable field, which is filled by a boolean . AutofillValue instances for autofilling a View can be obtained through AutofillValue#forToggle(boolean) , and the value passed to autofill a View can be fetched through AutofillValue#getToggleValue() . See also: getAutofillType() Constant Value: 2 (0x00000002)

DRAG_FLAG_GLOBAL Added in API level 24 public static final int DRAG_FLAG_GLOBAL Flag indicating that a drag can cross window boundaries. When startDragAndDrop(android.content.ClipData, android.view.View.DragShadowBuilder, java.lang.Object, int) is called with this flag set, all visible applications with targetSdkVersion >= API 24 will be able to participate in the drag operation and receive the dragged content. If this is the only flag set, then the drag recipient will only have access to text data and intents contained in the ClipData object. Access to URIs contained in the ClipData is determined by other DRAG_FLAG_GLOBAL_* flags Constant Value: 256 (0x00000100)

DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION Added in API level 24 public static final int DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION When this flag is used with DRAG_FLAG_GLOBAL_URI_READ and/or DRAG_FLAG_GLOBAL_URI_WRITE , the URI permission grant can be persisted across device reboots until explicitly revoked with Context.revokeUriPermission(Uri, int) Context.revokeUriPermission}. See also: Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION Constant Value: 64 (0x00000040)

DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION Added in API level 24 public static final int DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION When this flag is used with DRAG_FLAG_GLOBAL_URI_READ and/or DRAG_FLAG_GLOBAL_URI_WRITE , the URI permission grant applies to any URI that is a prefix match against the original granted URI. See also: Intent.FLAG_GRANT_PREFIX_URI_PERMISSION Constant Value: 128 (0x00000080)

DRAG_FLAG_GLOBAL_URI_READ Added in API level 24 public static final int DRAG_FLAG_GLOBAL_URI_READ When this flag is used with DRAG_FLAG_GLOBAL , the drag recipient will be able to request read access to the content URI(s) contained in the ClipData object. See also: Intent.FLAG_GRANT_READ_URI_PERMISSION Constant Value: 1 (0x00000001)

DRAG_FLAG_GLOBAL_URI_WRITE Added in API level 24 public static final int DRAG_FLAG_GLOBAL_URI_WRITE When this flag is used with DRAG_FLAG_GLOBAL , the drag recipient will be able to request write access to the content URI(s) contained in the ClipData object. See also: Intent.FLAG_GRANT_WRITE_URI_PERMISSION Constant Value: 2 (0x00000002)

DRAG_FLAG_OPAQUE Added in API level 24 public static final int DRAG_FLAG_OPAQUE Flag indicating that the drag shadow will be opaque. When startDragAndDrop(android.content.ClipData, android.view.View.DragShadowBuilder, java.lang.Object, int) is called with this flag set, the drag shadow will be opaque, otherwise, it will be semitransparent. Constant Value: 512 (0x00000200)

DRAWING_CACHE_QUALITY_AUTO

Deprecated in Added in API level 1 Deprecated in API level 28 public static final int DRAWING_CACHE_QUALITY_AUTO This constant was deprecated in API level 28.

The view drawing cache was largely made obsolete with the introduction of hardware-accelerated rendering in API 11. With hardware-acceleration, intermediate cache layers are largely unnecessary and can easily result in a net loss in performance due to the cost of creating and updating the layer. In the rare cases where caching layers are useful, such as for alpha animations, setLayerType(int, android.graphics.Paint) handles this with hardware rendering. For software-rendered snapshots of a small part of the View hierarchy or individual Views it is recommended to create a Canvas from either a Bitmap or Picture and call draw(android.graphics.Canvas) on the View. However these software-rendered usages are discouraged and have compatibility issues with hardware-only rendering features such as Config.HARDWARE bitmaps, real-time shadows, and outline clipping. For screenshots of the UI for feedback reports or unit testing the PixelCopy API is recommended. Enables automatic quality mode for the drawing cache. Constant Value: 0 (0x00000000)

DRAWING_CACHE_QUALITY_HIGH

Deprecated in Added in API level 1 Deprecated in API level 28 public static final int DRAWING_CACHE_QUALITY_HIGH This constant was deprecated in API level 28.

The view drawing cache was largely made obsolete with the introduction of hardware-accelerated rendering in API 11. With hardware-acceleration, intermediate cache layers are largely unnecessary and can easily result in a net loss in performance due to the cost of creating and updating the layer. In the rare cases where caching layers are useful, such as for alpha animations, setLayerType(int, android.graphics.Paint) handles this with hardware rendering. For software-rendered snapshots of a small part of the View hierarchy or individual Views it is recommended to create a Canvas from either a Bitmap or Picture and call draw(android.graphics.Canvas) on the View. However these software-rendered usages are discouraged and have compatibility issues with hardware-only rendering features such as Config.HARDWARE bitmaps, real-time shadows, and outline clipping. For screenshots of the UI for feedback reports or unit testing the PixelCopy API is recommended. Enables high quality mode for the drawing cache. Constant Value: 1048576 (0x00100000)

DRAWING_CACHE_QUALITY_LOW

Deprecated in Added in API level 1 Deprecated in API level 28 public static final int DRAWING_CACHE_QUALITY_LOW This constant was deprecated in API level 28.

The view drawing cache was largely made obsolete with the introduction of hardware-accelerated rendering in API 11. With hardware-acceleration, intermediate cache layers are largely unnecessary and can easily result in a net loss in performance due to the cost of creating and updating the layer. In the rare cases where caching layers are useful, such as for alpha animations, setLayerType(int, android.graphics.Paint) handles this with hardware rendering. For software-rendered snapshots of a small part of the View hierarchy or individual Views it is recommended to create a Canvas from either a Bitmap or Picture and call draw(android.graphics.Canvas) on the View. However these software-rendered usages are discouraged and have compatibility issues with hardware-only rendering features such as Config.HARDWARE bitmaps, real-time shadows, and outline clipping. For screenshots of the UI for feedback reports or unit testing the PixelCopy API is recommended. Enables low quality mode for the drawing cache. Constant Value: 524288 (0x00080000)

FIND_VIEWS_WITH_CONTENT_DESCRIPTION Added in API level 14 public static final int FIND_VIEWS_WITH_CONTENT_DESCRIPTION Find find views that contain the specified content description. See also: findViewsWithText(ArrayList, CharSequence, int) Constant Value: 2 (0x00000002)

FIND_VIEWS_WITH_TEXT Added in API level 14 public static final int FIND_VIEWS_WITH_TEXT Find views that render the specified text. See also: findViewsWithText(ArrayList, CharSequence, int) Constant Value: 1 (0x00000001)

FOCUSABLE Added in API level 26 public static final int FOCUSABLE This view wants keystrokes. Use with setFocusable(int) and android:focusable . Constant Value: 1 (0x00000001)

FOCUSABLES_ALL Added in API level 4 public static final int FOCUSABLES_ALL View flag indicating whether addFocusables(java.util.ArrayList, int, int) should add all focusable Views regardless if they are focusable in touch mode. Constant Value: 0 (0x00000000)

FOCUSABLES_TOUCH_MODE Added in API level 4 public static final int FOCUSABLES_TOUCH_MODE View flag indicating whether addFocusables(java.util.ArrayList, int, int) should add only Views focusable in touch mode. Constant Value: 1 (0x00000001)

FOCUSABLE_AUTO Added in API level 26 public static final int FOCUSABLE_AUTO This view determines focusability automatically. This is the default. Use with setFocusable(int) and android:focusable . Constant Value: 16 (0x00000010)

FOCUS_BACKWARD Added in API level 1 public static final int FOCUS_BACKWARD Use with focusSearch(int) . Move focus to the previous selectable item. Constant Value: 1 (0x00000001)

FOCUS_DOWN Added in API level 1 public static final int FOCUS_DOWN Use with focusSearch(int) . Move focus down. Constant Value: 130 (0x00000082)

FOCUS_FORWARD Added in API level 1 public static final int FOCUS_FORWARD Use with focusSearch(int) . Move focus to the next selectable item. Constant Value: 2 (0x00000002)

FOCUS_LEFT Added in API level 1 public static final int FOCUS_LEFT Use with focusSearch(int) . Move focus to the left. Constant Value: 17 (0x00000011)

FOCUS_RIGHT Added in API level 1 public static final int FOCUS_RIGHT Use with focusSearch(int) . Move focus to the right. Constant Value: 66 (0x00000042)

FOCUS_UP Added in API level 1 public static final int FOCUS_UP Use with focusSearch(int) . Move focus up. Constant Value: 33 (0x00000021)

GONE Added in API level 1 public static final int GONE This view is invisible, and it doesn't take any space for layout purposes. Use with setVisibility(int) and android:visibility . Constant Value: 8 (0x00000008)

HAPTIC_FEEDBACK_ENABLED Added in API level 3 public static final int HAPTIC_FEEDBACK_ENABLED View flag indicating whether this view should have haptic feedback enabled for events such as long presses. Constant Value: 268435456 (0x10000000)

IMPORTANT_FOR_ACCESSIBILITY_AUTO Added in API level 16 public static final int IMPORTANT_FOR_ACCESSIBILITY_AUTO Automatically determine whether a view is important for accessibility. Constant Value: 0 (0x00000000)

IMPORTANT_FOR_ACCESSIBILITY_NO Added in API level 16 public static final int IMPORTANT_FOR_ACCESSIBILITY_NO The view is not important for accessibility. Constant Value: 2 (0x00000002)

IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS Added in API level 19 public static final int IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS The view is not important for accessibility, nor are any of its descendant views. Constant Value: 4 (0x00000004)

IMPORTANT_FOR_ACCESSIBILITY_YES Added in API level 16 public static final int IMPORTANT_FOR_ACCESSIBILITY_YES The view is important for accessibility. Constant Value: 1 (0x00000001)

IMPORTANT_FOR_AUTOFILL_AUTO Added in API level 26 public static final int IMPORTANT_FOR_AUTOFILL_AUTO Automatically determine whether a view is important for autofill. See also: isImportantForAutofill()

setImportantForAutofill(int) Constant Value: 0 (0x00000000)

IMPORTANT_FOR_AUTOFILL_NO Added in API level 26 public static final int IMPORTANT_FOR_AUTOFILL_NO The view is not important for autofill, but its children (if any) will be traversed. See also: isImportantForAutofill()

setImportantForAutofill(int) Constant Value: 2 (0x00000002)

IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS Added in API level 26 public static final int IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS The view is not important for autofill, and its children (if any) will not be traversed. See also: isImportantForAutofill()

setImportantForAutofill(int) Constant Value: 8 (0x00000008)

IMPORTANT_FOR_AUTOFILL_YES Added in API level 26 public static final int IMPORTANT_FOR_AUTOFILL_YES The view is important for autofill, and its children (if any) will be traversed. See also: isImportantForAutofill()

setImportantForAutofill(int) Constant Value: 1 (0x00000001)

IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS Added in API level 26 public static final int IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS The view is important for autofill, but its children (if any) will not be traversed. See also: isImportantForAutofill()

setImportantForAutofill(int) Constant Value: 4 (0x00000004)

IMPORTANT_FOR_CONTENT_CAPTURE_AUTO Added in API level 30 public static final int IMPORTANT_FOR_CONTENT_CAPTURE_AUTO Automatically determine whether a view is important for content capture. See also: isImportantForContentCapture()

setImportantForContentCapture(int) Constant Value: 0 (0x00000000)

IMPORTANT_FOR_CONTENT_CAPTURE_NO Added in API level 30 public static final int IMPORTANT_FOR_CONTENT_CAPTURE_NO The view is not important for content capture, but its children (if any) will be traversed. See also: isImportantForContentCapture()

setImportantForContentCapture(int) Constant Value: 2 (0x00000002)

IMPORTANT_FOR_CONTENT_CAPTURE_NO_EXCLUDE_DESCENDANTS Added in API level 30 public static final int IMPORTANT_FOR_CONTENT_CAPTURE_NO_EXCLUDE_DESCENDANTS The view is not important for content capture, and its children (if any) will not be traversed. See also: isImportantForContentCapture()

setImportantForContentCapture(int) Constant Value: 8 (0x00000008)

IMPORTANT_FOR_CONTENT_CAPTURE_YES Added in API level 30 public static final int IMPORTANT_FOR_CONTENT_CAPTURE_YES The view is important for content capture, and its children (if any) will be traversed. See also: isImportantForContentCapture()

setImportantForContentCapture(int) Constant Value: 1 (0x00000001)

IMPORTANT_FOR_CONTENT_CAPTURE_YES_EXCLUDE_DESCENDANTS Added in API level 30 public static final int IMPORTANT_FOR_CONTENT_CAPTURE_YES_EXCLUDE_DESCENDANTS The view is important for content capture, but its children (if any) will not be traversed. See also: isImportantForContentCapture()

setImportantForContentCapture(int) Constant Value: 4 (0x00000004)

INVISIBLE Added in API level 1 public static final int INVISIBLE This view is invisible, but it still takes up space for layout purposes. Use with setVisibility(int) and android:visibility . Constant Value: 4 (0x00000004)

KEEP_SCREEN_ON Added in API level 1 public static final int KEEP_SCREEN_ON View flag indicating that the screen should remain on while the window containing this view is visible to the user. This effectively takes care of automatically setting the WindowManager's WindowManager.LayoutParams#FLAG_KEEP_SCREEN_ON . Constant Value: 67108864 (0x04000000)

LAYER_TYPE_HARDWARE Added in API level 11 public static final int LAYER_TYPE_HARDWARE Indicates that the view has a hardware layer. A hardware layer is backed by a hardware specific texture (generally Frame Buffer Objects or FBO on OpenGL hardware) and causes the view to be rendered using Android's hardware rendering pipeline, but only if hardware acceleration is turned on for the view hierarchy. When hardware acceleration is turned off, hardware layers behave exactly as software layers . A hardware layer is useful to apply a specific color filter and/or blending mode and/or translucency to a view and all its children. A hardware layer can be used to cache a complex view tree into a texture and reduce the complexity of drawing operations. For instance, when animating a complex view tree with a translation, a hardware layer can be used to render the view tree only once. A hardware layer can also be used to increase the rendering quality when rotation transformations are applied on a view. It can also be used to prevent potential clipping issues when applying 3D transforms on a view. See also: getLayerType()

setLayerType(int, android.graphics.Paint)

LAYER_TYPE_NONE

LAYER_TYPE_SOFTWARE Constant Value: 2 (0x00000002)

LAYER_TYPE_SOFTWARE Added in API level 11 public static final int LAYER_TYPE_SOFTWARE Indicates that the view has a software layer. A software layer is backed by a bitmap and causes the view to be rendered using Android's software rendering pipeline, even if hardware acceleration is enabled. Software layers have various usages: When the application is not using hardware acceleration, a software layer is useful to apply a specific color filter and/or blending mode and/or translucency to a view and all its children. When the application is using hardware acceleration, a software layer is useful to render drawing primitives not supported by the hardware accelerated pipeline. It can also be used to cache a complex view tree into a texture and reduce the complexity of drawing operations. For instance, when animating a complex view tree with a translation, a software layer can be used to render the view tree only once. Software layers should be avoided when the affected view tree updates often. Every update will require to re-render the software layer, which can potentially be slow (particularly when hardware acceleration is turned on since the layer will have to be uploaded into a hardware texture after every update.) See also: getLayerType()

setLayerType(int, android.graphics.Paint)

LAYER_TYPE_NONE

LAYER_TYPE_HARDWARE Constant Value: 1 (0x00000001)

LAYOUT_DIRECTION_INHERIT Added in API level 17 public static final int LAYOUT_DIRECTION_INHERIT Horizontal layout direction of this view is inherited from its parent. Use with setLayoutDirection(int) . Constant Value: 2 (0x00000002)

LAYOUT_DIRECTION_LOCALE Added in API level 17 public static final int LAYOUT_DIRECTION_LOCALE Horizontal layout direction of this view is from deduced from the default language script for the locale. Use with setLayoutDirection(int) . Constant Value: 3 (0x00000003)

LAYOUT_DIRECTION_LTR Added in API level 17 public static final int LAYOUT_DIRECTION_LTR Horizontal layout direction of this view is from Left to Right. Use with setLayoutDirection(int) . Constant Value: 0 (0x00000000)

LAYOUT_DIRECTION_RTL Added in API level 17 public static final int LAYOUT_DIRECTION_RTL Horizontal layout direction of this view is from Right to Left. Use with setLayoutDirection(int) . Constant Value: 1 (0x00000001)

MEASURED_HEIGHT_STATE_SHIFT Added in API level 11 public static final int MEASURED_HEIGHT_STATE_SHIFT Bit shift of MEASURED_STATE_MASK to get to the height bits for functions that combine both width and height into a single int, such as getMeasuredState() and the childState argument of resolveSizeAndState(int, int, int) . Constant Value: 16 (0x00000010)

MEASURED_SIZE_MASK Added in API level 11 public static final int MEASURED_SIZE_MASK Bits of getMeasuredWidthAndState() and getMeasuredWidthAndState() that provide the actual measured size. Constant Value: 16777215 (0x00ffffff)

MEASURED_STATE_MASK Added in API level 11 public static final int MEASURED_STATE_MASK Bits of getMeasuredWidthAndState() and getMeasuredWidthAndState() that provide the additional state bits. Constant Value: -16777216 (0xff000000)

MEASURED_STATE_TOO_SMALL Added in API level 11 public static final int MEASURED_STATE_TOO_SMALL Bit of getMeasuredWidthAndState() and getMeasuredWidthAndState() that indicates the measured size is smaller that the space the view would like to have. Constant Value: 16777216 (0x01000000)

NOT_FOCUSABLE Added in API level 26 public static final int NOT_FOCUSABLE This view does not want keystrokes. Use with setFocusable(int) and android:focusable . Constant Value: 0 (0x00000000)

NO_ID Added in API level 1 public static final int NO_ID Used to mark a View that has no ID. Constant Value: -1 (0xffffffff)

OVER_SCROLL_ALWAYS Added in API level 9 public static final int OVER_SCROLL_ALWAYS Always allow a user to over-scroll this view, provided it is a view that can scroll. See also: getOverScrollMode()

setOverScrollMode(int) Constant Value: 0 (0x00000000)

OVER_SCROLL_IF_CONTENT_SCROLLS Added in API level 9 public static final int OVER_SCROLL_IF_CONTENT_SCROLLS 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. See also: getOverScrollMode()

setOverScrollMode(int) Constant Value: 1 (0x00000001)

OVER_SCROLL_NEVER Added in API level 9 public static final int OVER_SCROLL_NEVER Never allow a user to over-scroll this view. See also: getOverScrollMode()

setOverScrollMode(int) Constant Value: 2 (0x00000002)

SCREEN_STATE_OFF Added in API level 16 public static final int SCREEN_STATE_OFF Indicates that the screen has changed state and is now off. See also: onScreenStateChanged(int) Constant Value: 0 (0x00000000)

SCREEN_STATE_ON Added in API level 16 public static final int SCREEN_STATE_ON Indicates that the screen has changed state and is now on. See also: onScreenStateChanged(int) Constant Value: 1 (0x00000001)

SCROLLBARS_INSIDE_INSET Added in API level 1 public static final int SCROLLBARS_INSIDE_INSET The scrollbar style to display the scrollbars inside the padded area, increasing the padding of the view. The scrollbars will not overlap the content area of the view. Constant Value: 16777216 (0x01000000)

SCROLLBARS_INSIDE_OVERLAY Added in API level 1 public static final int SCROLLBARS_INSIDE_OVERLAY The scrollbar style to display the scrollbars inside the content area, without increasing the padding. The scrollbars will be overlaid with translucency on the view's content. Constant Value: 0 (0x00000000)

SCROLLBARS_OUTSIDE_INSET Added in API level 1 public static final int SCROLLBARS_OUTSIDE_INSET The scrollbar style to display the scrollbars at the edge of the view, increasing the padding of the view. The scrollbars will only overlap the background, if any. Constant Value: 50331648 (0x03000000)

SCROLLBARS_OUTSIDE_OVERLAY Added in API level 1 public static final int SCROLLBARS_OUTSIDE_OVERLAY The scrollbar style to display the scrollbars at the edge of the view, without increasing the padding. The scrollbars will be overlaid with translucency. Constant Value: 33554432 (0x02000000)

SCROLLBAR_POSITION_DEFAULT Added in API level 11 public static final int SCROLLBAR_POSITION_DEFAULT Position the scroll bar at the default position as determined by the system. Constant Value: 0 (0x00000000)

SCROLLBAR_POSITION_LEFT Added in API level 11 public static final int SCROLLBAR_POSITION_LEFT Position the scroll bar along the left edge. Constant Value: 1 (0x00000001)

SCROLLBAR_POSITION_RIGHT Added in API level 11 public static final int SCROLLBAR_POSITION_RIGHT Position the scroll bar along the right edge. Constant Value: 2 (0x00000002)

SCROLL_AXIS_HORIZONTAL Added in API level 21 public static final int SCROLL_AXIS_HORIZONTAL Indicates scrolling along the horizontal axis. Constant Value: 1 (0x00000001)

SCROLL_AXIS_NONE Added in API level 21 public static final int SCROLL_AXIS_NONE Indicates no axis of view scrolling. Constant Value: 0 (0x00000000)

SCROLL_AXIS_VERTICAL Added in API level 21 public static final int SCROLL_AXIS_VERTICAL Indicates scrolling along the vertical axis. Constant Value: 2 (0x00000002)

SCROLL_INDICATOR_BOTTOM Added in API level 23 public static final int SCROLL_INDICATOR_BOTTOM Scroll indicator direction for the bottom edge of the view. See also: setScrollIndicators(int)

setScrollIndicators(int, int)

getScrollIndicators() Constant Value: 2 (0x00000002)

SCROLL_INDICATOR_END Added in API level 23 public static final int SCROLL_INDICATOR_END Scroll indicator direction for the ending edge of the view. Resolved according to the view's layout direction, see getLayoutDirection() for more information. See also: setScrollIndicators(int)

setScrollIndicators(int, int)

getScrollIndicators() Constant Value: 32 (0x00000020)

SCROLL_INDICATOR_LEFT Added in API level 23 public static final int SCROLL_INDICATOR_LEFT Scroll indicator direction for the left edge of the view. See also: setScrollIndicators(int)

setScrollIndicators(int, int)

getScrollIndicators() Constant Value: 4 (0x00000004)

SCROLL_INDICATOR_RIGHT Added in API level 23 public static final int SCROLL_INDICATOR_RIGHT Scroll indicator direction for the right edge of the view. See also: setScrollIndicators(int)

setScrollIndicators(int, int)

getScrollIndicators() Constant Value: 8 (0x00000008)

SCROLL_INDICATOR_START Added in API level 23 public static final int SCROLL_INDICATOR_START Scroll indicator direction for the starting edge of the view. Resolved according to the view's layout direction, see getLayoutDirection() for more information. See also: setScrollIndicators(int)

setScrollIndicators(int, int)

getScrollIndicators() Constant Value: 16 (0x00000010)

SCROLL_INDICATOR_TOP Added in API level 23 public static final int SCROLL_INDICATOR_TOP Scroll indicator direction for the top edge of the view. See also: setScrollIndicators(int)

setScrollIndicators(int, int)

getScrollIndicators() Constant Value: 1 (0x00000001)

SOUND_EFFECTS_ENABLED Added in API level 1 public static final int SOUND_EFFECTS_ENABLED View flag indicating whether this view should have sound effects enabled for events such as clicking and touching. Constant Value: 134217728 (0x08000000)

STATUS_BAR_HIDDEN

Deprecated in Added in API level 11 Deprecated in API level 15 public static final int STATUS_BAR_HIDDEN This constant was deprecated in API level 15.

Use SYSTEM_UI_FLAG_LOW_PROFILE instead. Constant Value: 1 (0x00000001)

STATUS_BAR_VISIBLE

Deprecated in Added in API level 11 Deprecated in API level 15 public static final int STATUS_BAR_VISIBLE This constant was deprecated in API level 15.

Use SYSTEM_UI_FLAG_VISIBLE instead. Constant Value: 0 (0x00000000)

SYSTEM_UI_FLAG_FULLSCREEN

Deprecated in Added in API level 16 Deprecated in API level 30 public static final int SYSTEM_UI_FLAG_FULLSCREEN This constant was deprecated in API level 30.

Use WindowInsetsController#hide(int) with Type#statusBars() instead. Flag for setSystemUiVisibility(int) : View has requested to go into the normal fullscreen mode so that its content can take over the screen while still allowing the user to interact with the application. This has the same visual effect as WindowManager.LayoutParams.FLAG_FULLSCREEN , meaning that non-critical screen decorations (such as the status bar) will be hidden while the user is in the View's window, focusing the experience on that content. Unlike the window flag, if you are using ActionBar in overlay mode with Window#FEATURE_ACTION_BAR_OVERLAY , then enabling this flag will also hide the action bar. This approach to going fullscreen is best used over the window flag when it is a transient state -- that is, the application does this at certain points in its user interaction where it wants to allow the user to focus on content, but not as a continuous state. For situations where the application would like to simply stay full screen the entire time (such as a game that wants to take over the screen), the window flag is usually a better approach. The state set here will be removed by the system in various situations (such as the user moving to another application) like the other system UI states. When using this flag, the application should provide some easy facility for the user to go out of it. A common example would be in an e-book reader, where tapping on the screen brings back whatever screen and UI decorations that had been hidden while the user was immersed in reading the book. See also: setSystemUiVisibility(int) Constant Value: 4 (0x00000004)

SYSTEM_UI_FLAG_HIDE_NAVIGATION

Deprecated in Added in API level 14 Deprecated in API level 30 public static final int SYSTEM_UI_FLAG_HIDE_NAVIGATION This constant was deprecated in API level 30.

Use WindowInsetsController#hide(int) with Type#navigationBars() instead. Flag for setSystemUiVisibility(int) : View has requested that the system navigation be temporarily hidden. This is an even less obtrusive state than that called for by SYSTEM_UI_FLAG_LOW_PROFILE ; on devices that draw essential navigation controls (Home, Back, and the like) on screen, SYSTEM_UI_FLAG_HIDE_NAVIGATION will cause those to disappear. This is useful (in conjunction with the FLAG_FULLSCREEN and FLAG_LAYOUT_IN_SCREEN window flags) for displaying content using every last pixel on the display. There is a limitation: because navigation controls are so important, the least user interaction will cause them to reappear immediately. When this happens, both this flag and SYSTEM_UI_FLAG_FULLSCREEN will be cleared automatically, so that both elements reappear at the same time. See also: setSystemUiVisibility(int) Constant Value: 2 (0x00000002)

SYSTEM_UI_FLAG_IMMERSIVE

Deprecated in Added in API level 19 Deprecated in API level 30 public static final int SYSTEM_UI_FLAG_IMMERSIVE This constant was deprecated in API level 30.

Use WindowInsetsController#BEHAVIOR_SHOW_BARS_BY_SWIPE instead. Flag for setSystemUiVisibility(int) : View would like to remain interactive when hiding the navigation bar with SYSTEM_UI_FLAG_HIDE_NAVIGATION . If this flag is not set, SYSTEM_UI_FLAG_HIDE_NAVIGATION will be force cleared by the system on any user interaction. Since this flag is a modifier for SYSTEM_UI_FLAG_HIDE_NAVIGATION , it only has an effect when used in combination with that flag. Constant Value: 2048 (0x00000800)

SYSTEM_UI_FLAG_IMMERSIVE_STICKY

Deprecated in Added in API level 19 Deprecated in API level 30 public static final int SYSTEM_UI_FLAG_IMMERSI