Defines the next view to give focus to when the next focus is
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.

Defines the next view to give focus to when the next focus is
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.

Defines the next view to give focus to when the next focus is
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.

Defines the next view to give focus to when the next focus is
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.

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 getTime().

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.

It also sets the autofill options in the structure; when overridden, it should set it as
well, either explicitly by calling setAutofillOptions(CharSequence[])
or implicitly by calling super.onProvideAutofillStructure(structure, flags).

Indicates whether the view is currently tracking transient state that the
app should not need to concern itself with saving and restoring, but that
the framework should take special note to preserve when possible.

This method was deprecated
in API level 23.
As of M, this property is ignored.
Child views may no longer be forced to cache their rendering state by their parents.
Use setLayerType(int, Paint) on individual Views instead.

Call this to try to give focus to a specific view or to one of its descendants
and give it hints about the direction and a specific rectangle that the focus
is coming from.
Looks for a view to give focus to respecting the setting specified by
getDescendantFocusability().

This method was deprecated
in API level 23.
As of M, this property is ignored.
Child views may no longer be forced to cache their rendering state by their parents.
Use setLayerType(int, Paint) on individual Views instead.

This method tells the ViewGroup that the given View object, which should have this
ViewGroup as its parent,
should be kept around (re-displayed when the ViewGroup draws its children) even if it
is removed from its parent.

Convenience method for sending a TYPE_ANNOUNCEMENTAccessibilityEvent to make an announcement which is related to some
sort of a context change for which none of the events representing UI transitions
is a good fit.

Indicates whether the view is currently tracking transient state that the
app should not need to concern itself with saving and restoring, but that
the framework should take special note to preserve when possible.

Sets whether or not this view should account for system screen decorations
such as the status bar and inset its content; that is, controlling whether
the default implementation of fitSystemWindows(Rect) will be
executed.

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.

XML attributes

android:dropDownHorizontalOffset

Amount of pixels by which the drop down should be offset horizontally.

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:dropDownSelector

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".

android:dropDownVerticalOffset

Amount of pixels by which the drop down should be offset vertically.

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:dropDownWidth

Width of the dropdown in spinnerMode="dropdown".

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).

Must be one of the following constant values.

Constant

Value

Description

fill_parent

ffffffff

The dropdown should fill the width of the screen.
This constant is deprecated starting from API Level 8 and
is replaced by match_parent.

match_parent

ffffffff

The dropdown should fit the width of the screen.
Introduced in API Level 8.

android:gravity

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.

end

800005

Push object to the end of its container, not changing its size.

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.

Spinner

Constructs a new spinner with the given context's theme, the supplied
attribute set, and default style attribute. mode may be one
of MODE_DIALOG or MODE_DROPDOWN and determines how the
user will select choices from the spinner.

Parameters

context

Context: The Context the view is running in, through which it can
access the current theme, resources, etc.

attrs

AttributeSet: The attributes of the XML tag that is inflating the view.

defStyleAttr

int: An attribute in the current theme that contains a
reference to a style resource that supplies default
values for the view. Can be 0 to not look for defaults.

mode

int: Constant describing how the user will select choices from the
spinner.

Spinner

Constructs a new spinner with the given context's theme, the supplied
attribute set, and default styles. mode may be one of
MODE_DIALOG or MODE_DROPDOWN and determines how the
user will select choices from the spinner.

Parameters

context

Context: The Context the view is running in, through which it can
access the current theme, resources, etc.

attrs

AttributeSet: The attributes of the XML tag that is inflating the view.

defStyleAttr

int: An attribute in the current theme that contains a
reference to a style resource that supplies default
values for the view. Can be 0 to not look for
defaults.

defStyleRes

int: A resource identifier of a style resource that
supplies default values for the view, used only if
defStyleAttr is 0 or can not be found in the theme.
Can be 0 to not look for defaults.

mode

int: Constant describing how the user will select choices from
the spinner.

Public methods

getAccessibilityClassName

Return the class name of this object to be used for accessibility purposes.
Subclasses should only override this if they are implementing something that
should be seen as a completely new class of view when used by accessibility,
unrelated to the class it is deriving from. This is used to fill in
AccessibilityNodeInfo.setClassName.

getDropDownWidth

Get the configured width of the spinner's popup window of choices in pixels.
The returned value may also be MATCH_PARENT
meaning the popup window will match the width of the Spinner itself, or
WRAP_CONTENT to wrap to the measured size
of contained dropdown list items.

onResolvePointerIcon

Returns the pointer icon for the motion event, or null if it doesn't specify the icon.
The default implementation does not care the location or event types, but some subclasses
may use it (such as WebViews).

onSaveInstanceState

Hook allowing a view to generate a representation of its internal state
that can later be used to create a new instance with that same state.
This state should only contain information that is not persistent or can
not be reconstructed later. For example, you will never store your
current position on screen because that will be computed again when a
new instance of the view is placed in its view hierarchy.

Some examples of things you may store here: the current cursor position
in a text view (but usually not the text itself since that is stored in a
content provider or other persistent storage), the currently selected
item in a list view.

setDropDownWidth

Set the width of the spinner's popup window of choices in pixels. This value
may also be set to MATCH_PARENT
to match the width of the Spinner itself, or
WRAP_CONTENT to wrap to the measured size
of contained dropdown list items.

onMeasure

Measure the view and its content to determine the measured width and the
measured height. This method is invoked by measure(int, int) and
should be overridden by subclasses to provide accurate and efficient
measurement of their contents.

The base class implementation of measure defaults to the background size,
unless a larger size is allowed by the MeasureSpec. Subclasses should
override onMeasure(int, int) to provide better measurements of
their content.