A radio button is a two-states button that can be either checked or unchecked. When the radio button is unchecked, the user can press or click it to check it. However, contrary to a CheckBox, a radio button cannot be unchecked by the user once checked.
Radio buttons are normally used together in a RadioGroup. When several radio buttons live inside a radio group, checking one radio button unchecks all the others.
XML attributes
See CompoundButton Attributes, Button Attributes, TextView Attributes, View Attributes
Attribute name | Related methods | |
---|---|---|
android:autoLink | setAutoLinkMask(int) |
Controls whether links such as urls and email addresses are automatically found and converted to clickable links. |
android:autoText | setKeyListener(KeyListener) |
If set, specifies that this TextView has a textual input method and automatically corrects some common spelling errors. |
android:bufferType | setText(CharSequence,TextView.BufferType) |
Determines what the minimum type that getText() will return. |
android:capitalize | setKeyListener(KeyListener) |
If set, specifies that this TextView has a textual input method and should automatically capitalize what the user types. |
android:cursorVisible | setCursorVisible(boolean) |
Makes the cursor visible (the default) or invisible
Must be a boolean value, either " |
android:digits | setKeyListener(KeyListener) |
If set, specifies that this TextView has a numeric input method and that these specific characters are the ones that it will accept. |
android:drawableBottom | setCompoundDrawablesWithIntrinsicBounds(Drawable,Drawable,Drawable,Drawable) |
The drawable to be drawn below the text. |
android:drawableLeft | setCompoundDrawablesWithIntrinsicBounds(Drawable,Drawable,Drawable,Drawable) |
The drawable to be drawn to the left of the text. |
android:drawablePadding | setCompoundDrawablePadding(int) |
The padding between the drawables and the text. |
android:drawableRight | setCompoundDrawablesWithIntrinsicBounds(Drawable,Drawable,Drawable,Drawable) |
The drawable to be drawn to the right of the text. |
android:drawableTop | setCompoundDrawablesWithIntrinsicBounds(Drawable,Drawable,Drawable,Drawable) |
The drawable to be drawn above the text. |
android:editable | If set, specifies that this TextView has an input method. | |
android:ellipsize | setEllipsize(TextUtils.TruncateAt) |
If set, causes words that are longer than the view is wide to be ellipsized instead of broken in the middle. |
android:ems | setEms(int) |
Makes the TextView be exactly this many ems wide
Must be an integer value, such as " |
android:freezesText | setFreezesText(boolean) |
If set, the text view will include its current complete text inside of its frozen icicle in addition to meta-data such as the current cursor position. |
android:gravity | setGravity(int) |
Vertical gravity (top, center_vertical, bottom) when the text is smaller than the view. |
android:height | setHeight(int) |
Makes the TextView be exactly this many pixels tall. |
android:hint | setHint(int) |
Hint text to display when the text is empty. |
android:includeFontPadding | setIncludeFontPadding(boolean) |
Leave enough room for ascenders and descenders instead of using the font ascent and descent strictly. |
android:inputMethod | setKeyListener(KeyListener) |
If set, specifies that this TextView should use the specified input method (specified by fully-qualified class name). |
android:lines | setLines(int) |
Makes the TextView be exactly this many lines tall
Must be an integer value, such as " |
android:linksClickable | setLinksClickable(boolean) |
If set to false, keeps the movement method from being set to the link movement method even if autoLink causes links to be found. |
android:maxEms | setMaxEms(int) |
Makes the TextView be at most this many ems wide
Must be an integer value, such as " |
android:maxHeight | setMaxHeight(int) |
Makes the TextView be at most this many pixels tall
Must be a dimension value, which is a floating point number appended with a unit such as " |
android:maxLength | setFilters(InputFilter) |
Set an input filter to constrain the text length to the specified number. |
android:maxLines | setMaxLines(int) |
Makes the TextView be at most this many lines tall
Must be an integer value, such as " |
android:maxWidth | setMaxWidth(int) |
Makes the TextView be at most this many pixels wide
Must be a dimension value, which is a floating point number appended with a unit such as " |
android:minEms | setMinEms(int) |
Makes the TextView be at least this many ems wide
Must be an integer value, such as " |
android:minHeight | setMinHeight(int) |
Makes the TextView be at least this many pixels tall
Must be a dimension value, which is a floating point number appended with a unit such as " |
android:minLines | setMinLines(int) |
Makes the TextView be at least this many lines tall
Must be an integer value, such as " |
android:minWidth | setMinWidth(int) |
Makes the TextView be at least this many pixels wide
Must be a dimension value, which is a floating point number appended with a unit such as " |
android:numeric | setKeyListener(KeyListener) |
If set, specifies that this TextView has a numeric input method. |
android:password | setTransformationMethod(TransformationMethod) |
Whether the characters of the field are displayed as password dots instead of themselves. |
android:phoneNumber | setKeyListener(KeyListener) |
If set, specifies that this TextView has a phone number input method. |
android:scrollHorizontally | setHorizontallyScrolling(boolean) |
Whether the text is allowed to be wider than the view (and therefore can be scrolled horizontally). |
android:selectAllOnFocus | setSelectAllOnFocus(boolean) |
If the text is selectable, select it all when the view takes focus instead of moving the cursor to the start or end. |
android:shadowColor | setShadowLayer(float,float,float,int) |
Place a shadow of the specified color behind the text. |
android:shadowDx | setShadowLayer(float,float,float,int) |
Horizontal offset of the shadow. |
android:shadowDy | setShadowLayer(float,float,float,int) |
Vertical offset of the shadow. |
android:shadowRadius | setShadowLayer(float,float,float,int) |
Radius of the shadow. |
android:singleLine | setTransformationMethod(TransformationMethod) |
Constrains the text to a single horizontally scrolling line instead of letting it wrap onto multiple lines, and advances focus instead of inserting a newline when you press the enter key. |
android:text | setText(CharSequence) |
Text to display. |
android:textColor | setTextColor(ColorStateList) |
Text color. |
android:textColorHighlight | setHighlightColor(int) |
Color of the text selection highlight. |
android:textColorHint | setHintTextColor(int) |
Color of the hint text. |
android:textColorLink | setLinkTextColor(int) |
Text color for links. |
android:textScaleX | setTextScaleX(float) |
Sets the horizontal scaling factor for the text
Must be a floating point value, such as " |
android:textSize | setTextSize(float) |
Size of the text. |
android:textStyle | setTypeface(Typeface) |
Style (bold, italic, bolditalic) for the text. |
android:typeface | setTypeface(Typeface) |
Typeface (normal, sans, serif, monospace) for the text. |
android:width | setWidth(int) |
Makes the TextView be exactly this many pixels wide. |
Attribute name | Related methods | |
---|---|---|
android:background | setBackgroundResource(int) |
A drawable to use as the background. |
android:clickable | setClickable(boolean) |
Defines whether this view reacts to click events. |
android:drawingCacheQuality | setDrawingCacheQuality(int) |
Defines the quality of translucent drawing caches. |
android:fadingEdge | setVerticalFadingEdgeEnabled(boolean) |
Defines which edges should be fadeded on scrolling. |
android:fadingEdgeLength | getVerticalFadingEdgeLength() |
Defines the length of the fading edges. |
android:fitsSystemWindows | Boolean internal attribute to adjust view layout based on system windows such as the status bar. | |
android:focusable | setFocusable(boolean) |
Boolean that controls whether a view can take focus. |
android:focusableInTouchMode | setFocusableInTouchMode(boolean) |
Boolean that controls whether a view can take focus while in touch mode. |
android:id | setId(int) |
Supply an identifier name for this view, to later retrieve it with View.findViewById() or Activity.findViewById(). |
android:keepScreenOn | setKeepScreenOn(boolean) |
Controls whether the view's window should keep the screen on while visible. |
android:longClickable | setLongClickable(boolean) |
Defines whether this view reacts to long click events. |
android:nextFocusDown | setNextFocusDownId(int) |
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. |
android:nextFocusLeft | setNextFocusLeftId(int) |
Defines the next view to give focus to when the next focus is FOCUS_LEFT. |
android:nextFocusRight | setNextFocusRightId(int) |
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. |
android:nextFocusUp | setNextFocusUpId(int) |
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. |
android:padding | setPadding(int,int,int,int) |
Sets the padding, in pixels, of all four edges. |
android:paddingBottom | setPadding(int,int,int,int) |
Sets the padding, in pixels, of the bottom edge; see padding. |
android:paddingLeft | setPadding(int,int,int,int) |
Sets the padding, in pixels, of the left edge; see padding. |
android:paddingRight | setPadding(int,int,int,int) |
Sets the padding, in pixels, of the right edge; see padding. |
android:paddingTop | setPadding(int,int,int,int) |
Sets the padding, in pixels, of the top edge; see padding. |
android:saveEnabled | setSaveEnabled(boolean) |
If unset, no state will be saved for this view when it is being frozen. |
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
Must be a boolean value, either " |
|
android:scrollbarSize | Sets the width of vertical scrollbars and height of horizontal scrollbars. | |
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:visibility | setVisibility(int) |
Controls the initial visibility of the view. |
Value | ||||
---|---|---|---|---|
int | DRAWING_CACHE_QUALITY_AUTO | Enables automatic quality mode for the drawing cache. |
0 | 0x00000000 |
int | DRAWING_CACHE_QUALITY_HIGH | Enables high quality mode for the drawing cache. |
1048576 | 0x00100000 |
int | DRAWING_CACHE_QUALITY_LOW | Enables low quality mode for the drawing cache. |
524288 | 0x00080000 |
int[] | EMPTY_STATE_SET | Indicates the view has no states set. | ||
int[] | ENABLED_FOCUSED_SELECTED_STATE_SET | Indicates the view is enabled, focused and selected. | ||
int[] | ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET | Indicates the view is enabled, focused, selected and its window has the focus. | ||
int[] | ENABLED_FOCUSED_STATE_SET | Indicates the view is enabled and has the focus. | ||
int[] | ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET | Indicates the view is enabled, focused and its window has the focus. | ||
int[] | ENABLED_SELECTED_STATE_SET | Indicates the view is enabled and selected. | ||
int[] | ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET | Indicates the view is enabled, selected and its window has the focus. | ||
int[] | ENABLED_STATE_SET | Indicates the view is enabled. | ||
int[] | ENABLED_WINDOW_FOCUSED_STATE_SET | Indicates the view is enabled and that its window has focus. | ||
int[] | FOCUSED_SELECTED_STATE_SET | Indicates the view is focused and selected. | ||
int[] | FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET | Indicates the view is focused, selected and its window has the focus. | ||
int[] | FOCUSED_STATE_SET | Indicates the view is focused. | ||
int[] | FOCUSED_WINDOW_FOCUSED_STATE_SET | Indicates the view has the focus and that its window has the focus. | ||
int | FOCUS_BACKWARD | Use with focusSearch(int). | 1 | 0x00000001 |
int | FOCUS_DOWN | Use with focusSearch(int). | 130 | 0x00000082 |
int | FOCUS_FORWARD | Use with focusSearch(int). | 2 | 0x00000002 |
int | FOCUS_LEFT | Use with focusSearch(int). | 17 | 0x00000011 |
int | FOCUS_RIGHT | Use with focusSearch(int). | 66 | 0x00000042 |
int | FOCUS_UP | Use with focusSearch(int). | 33 | 0x00000021 |
int | GONE | This view is invisible, and it doesn't take any space for layout purposes. | 8 | 0x00000008 |
int | INVISIBLE | This view is invisible, but it still takes up space for layout purposes. | 4 | 0x00000004 |
int | KEEP_SCREEN_ON | View flag indicating that the screen should remain on while the window containing this view is visible to the user. | 67108864 | 0x04000000 |
int | NO_ID | Used to mark a View that has no ID. | -1 | 0xffffffff |
int[] | PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET | Indicates the view is pressed, enabled, focused and selected. | ||
int[] | PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET | Indicates the view is pressed, enabled, focused, selected and its window has the focus. | ||
int[] | PRESSED_ENABLED_FOCUSED_STATE_SET | Indicates the view is pressed, enabled and focused. | ||
int[] | PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET | Indicates the view is pressed, enabled, focused and its window has the focus. | ||
int[] | PRESSED_ENABLED_SELECTED_STATE_SET | Indicates the view is pressed, enabled and selected. | ||
int[] | PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET | Indicates the view is pressed, enabled, selected and its window has the focus. | ||
int[] | PRESSED_ENABLED_STATE_SET | Indicates the view is pressed and enabled. | ||
int[] | PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET | Indicates the view is pressed, enabled and its window has the focus. | ||
int[] | PRESSED_FOCUSED_SELECTED_STATE_SET | Indicates the view is pressed, focused and selected. | ||
int[] | PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET | Indicates the view is pressed, focused, selected and its window has the focus. | ||
int[] | PRESSED_FOCUSED_STATE_SET | Indicates the view is pressed and focused. | ||
int[] | PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET | Indicates the view is pressed, focused and its window has the focus. | ||
int[] | PRESSED_SELECTED_STATE_SET | Indicates the view is pressed and selected. | ||
int[] | PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET | Indicates the view is pressed, selected and its window has the focus. | ||
int[] | PRESSED_WINDOW_FOCUSED_STATE_SET | Indicates the view is pressed and its window has the focus. | ||
int | SCROLLBARS_INSIDE_INSET | The scrollbar style to display the scrollbars inside the padded area, increasing the padding of the view. | 16777216 | 0x01000000 |
int | SCROLLBARS_INSIDE_OVERLAY | The scrollbar style to display the scrollbars inside the content area, without increasing the padding. | 0 | 0x00000000 |
int | SCROLLBARS_OUTSIDE_INSET | The scrollbar style to display the scrollbars at the edge of the view, increasing the padding of the view. | 50331648 | 0x03000000 |
int | SCROLLBARS_OUTSIDE_OVERLAY | The scrollbar style to display the scrollbars at the edge of the view, without increasing the padding. | 33554432 | 0x02000000 |
int[] | SELECTED_STATE_SET | Indicates the view is selected. | ||
int[] | SELECTED_WINDOW_FOCUSED_STATE_SET | Indicates the view is selected and that its window has the focus. | ||
String | VIEW_LOG_TAG | The logging tag used by this class with android.util.Log. | "View" | |
int | VISIBLE | This view is visible. | 0 | 0x00000000 |
int[] | WINDOW_FOCUSED_STATE_SET | Indicates the view's window has focus. |
protected | int | mBottom | The distance in pixels from the top edge of this view's parent to the bottom edge of this view. | ||
protected | Context | mContext | The application environment this view lives in. | ||
protected | ViewGroup.LayoutParams | mLayoutParams | The layout parameters associated with this view and used by the parent ViewGroup to determine how this view should be laid out. | ||
protected | int | mLeft | The distance in pixels from the left edge of this view's parent to the left edge of this view. | ||
protected | final | int[] | mLocation | Used to store a pair of coordinates, for instance returned values returned by getLocationInWindow(int[]). | |
protected | View.OnClickListener | mOnClickListener | Listener used to dispatch click events. | ||
protected | View.OnCreateContextMenuListener | mOnCreateContextMenuListener | Listener used to build the context menu. | ||
protected | View.OnFocusChangeListener | mOnFocusChangeListener | Listener used to dispatch focus change events. | ||
protected | View.OnLongClickListener | mOnLongClickListener | Listener used to dispatch long click events. | ||
protected | int | mPaddingBottom | The bottom padding in pixels, that is the distance in pixels between the bottom edge of this view and the bottom edge of its content. | ||
protected | int | mPaddingLeft | The left padding in pixels, that is the distance in pixels between the left edge of this view and the left edge of its content. | ||
protected | int | mPaddingRight | The right padding in pixels, that is the distance in pixels between the right edge of this view and the right edge of its content. | ||
protected | int | mPaddingTop | The top padding in pixels, that is the distance in pixels between the top edge of this view and the top edge of its content. | ||
protected | ViewParent | mParent | The parent this view is attached to. | ||
protected | int | mRight | The distance in pixels from the left edge of this view's parent to the right edge of this view. | ||
protected | int | mScrollX | The offset, in pixels, by which the content of this view is scrolled horizontally. | ||
protected | int | mScrollY | The offset, in pixels, by which the content of this view is scrolled vertically. | ||
protected | Object | mTag | The view's tag. | ||
protected | int | mTop | The distance in pixels from the top edge of this view's parent to the top edge of this view. | ||
protected | int | mUserPaddingBottom | Cache the paddingBottom set by the user to append to the scrollbar's size. | ||
protected | int | mUserPaddingRight | Cache the paddingRight set by the user to append to the scrollbar's size. |
RadioButton(Context context) | ||||||
RadioButton(Context context, AttributeSet attrs) | ||||||
RadioButton(Context context, AttributeSet attrs, int defStyle) |
void | toggle() | |||||
Change the checked state of the view to the inverse of its current state
If the radio button is already checked, this method will not toggle the radio button. |
void | drawableStateChanged() | |||||
This function is called whenever the state of the view changes in such a way that it impacts the state of drawables being shown. | ||||||
boolean | isChecked() | |||||
int[] | onCreateDrawableState(int extraSpace) | |||||
Generate the new Drawable state for this view. | ||||||
void | onDraw(Canvas canvas) | |||||
Implement this to do your drawing. | ||||||
void | onRestoreInstanceState(Parcelable state) | |||||
Hook allowing a view to re-apply a representation of its internal state that had previously been generated by onSaveInstanceState(). | ||||||
Parcelable | 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. | ||||||
boolean | performClick() | |||||
Call this view's OnClickListener, if it is defined. | ||||||
void | setButtonDrawable(int resid) | |||||
Set the background to a given Drawable, identified by its resource id. | ||||||
void | setButtonDrawable(Drawable d) | |||||
Set the background to a given Drawable | ||||||
void | setChecked(boolean checked) | |||||
Changes the checked state of this button. |
||||||
void | setOnCheckedChangeListener(CompoundButton.OnCheckedChangeListener listener) | |||||
Register a callback to be invoked when the checked state of this button changes. | ||||||
void | toggle() | |||||
Change the checked state of the view to the inverse of its current state |
void | addTextChangedListener(TextWatcher watcher) | |||||
Adds a TextWatcher to the list of those whose methods are called whenever this TextView's text changes. | ||||||
final | void | append(CharSequence text) | ||||
Convenience method: Append the specified text to the TextView's display buffer, upgrading it to BufferType.EDITABLE if it was not already editable. | ||||||
void | append(CharSequence text, int start, int end) | |||||
Convenience method: Append the specified text slice to the TextView's display buffer, upgrading it to BufferType.EDITABLE if it was not already editable. | ||||||
int | computeHorizontalScrollRange() | |||||
Compute the horizontal range that the horizontal scrollbar represents. |
||||||
void | computeScroll() | |||||
Called by a parent to request that a child update its values for mScrollX and mScrollY if necessary. | ||||||
int | computeVerticalScrollRange() | |||||
Compute the vertical range that the vertical scrollbar represents. |
||||||
void | debug(int depth) | |||||
Prints information about this view in the log output, with the tag VIEW_LOG_TAG. | ||||||
void | drawableStateChanged() | |||||
This function is called whenever the state of the view changes in such a way that it impacts the state of drawables being shown. | ||||||
final | int | getAutoLinkMask() | ||||
Gets the autolink mask of the text. | ||||||
int | getBaseline() | |||||
Return the offset of the widget's text baseline from the widget's top boundary. |
||||||
int | getCompoundDrawablePadding() | |||||
Returns the padding between the compound drawables and the text. | ||||||
Drawable[] | getCompoundDrawables() | |||||
Returns drawables for the left, top, right, and bottom borders. | ||||||
int | getCompoundPaddingBottom() | |||||
Returns the bottom padding of the view, plus space for the bottom Drawable if any. | ||||||
int | getCompoundPaddingLeft() | |||||
Returns the left padding of the view, plus space for the left Drawable if any. | ||||||
int | getCompoundPaddingRight() | |||||
Returns the right padding of the view, plus space for the right Drawable if any. | ||||||
int | getCompoundPaddingTop() | |||||
Returns the top padding of the view, plus space for the top Drawable if any. | ||||||
final | int | getCurrentHintTextColor() | ||||
Return the current color selected to paint the hint text. |
||||||
final | int | getCurrentTextColor() | ||||
Return the current color selected for normal text. |
||||||
boolean | getDefaultEditable() | |||||
Subclasses override this to specify default editability. | ||||||
MovementMethod | getDefaultMovementMethod() | |||||
Subclasses override this to specify a default movement method. | ||||||
TextUtils.TruncateAt | getEllipsize() | |||||
Returns where, if anywhere, words that are longer than the view is wide should be ellipsized. | ||||||
CharSequence | getError() | |||||
Returns the error message that was set to be displayed with
setError(CharSequence), or null if no error was set
or if it the error was cleared by the widget after user input. |
||||||
int | getExtendedPaddingBottom() | |||||
Returns the extended bottom padding of the view, including both the bottom Drawable if any and any extra space to keep more than maxLines of text from showing. | ||||||
int | getExtendedPaddingTop() | |||||
Returns the extended top padding of the view, including both the top Drawable if any and any extra space to keep more than maxLines of text from showing. | ||||||
InputFilter[] | getFilters() | |||||
Returns the current list of input filters. | ||||||
void | getFocusedRect(Rect r) | |||||
When a view has focus and the user navigates away from it, the next view is searched for starting from the rectangle filled in by this method. | ||||||
boolean | getFreezesText() | |||||
Return whether this text view is including its entire text contents in frozen icicles. | ||||||
int | getGravity() | |||||
Returns the horizontal and vertical alignment of this TextView. | ||||||
CharSequence | getHint() | |||||
Returns the hint that is displayed when the text of the TextView is empty. | ||||||
final | ColorStateList | getHintTextColors() | ||||
Return the color used to paint the hint text. |
||||||
final | KeyListener | getKeyListener() | ||||
final | Layout | getLayout() | ||||
int | getLineBounds(int line, Rect bounds) | |||||
Return the baseline for the specified line (0...getLineCount() - 1) If bounds is not null, return the top, left, right, bottom extents of the specified line in it. | ||||||
int | getLineCount() | |||||
Return the number of lines of text, or 0 if the internal Layout has not been built. | ||||||
int | getLineHeight() | |||||
final | ColorStateList | getLinkTextColors() | ||||
Returns the color used to paint links in the text. |
||||||
final | boolean | getLinksClickable() | ||||
Returns whether the movement method will automatically be set to LinkMovementMethod if setAutoLinkMask(int) has been set to nonzero and links are detected in setText(char[], int, int). | ||||||
final | MovementMethod | getMovementMethod() | ||||
TextPaint | getPaint() | |||||
int | getPaintFlags() | |||||
int | getSelectionEnd() | |||||
Convenience for getSelectionEnd(CharSequence). | ||||||
int | getSelectionStart() | |||||
Convenience for getSelectionStart(CharSequence). | ||||||
CharSequence | getText() | |||||
Return the text the TextView is displaying. | ||||||
static | int | getTextColor(Context context, TypedArray attrs, int def) | ||||
Returns the default color from the TextView_textColor attribute from the AttributeSet, if set, or the default color from the TextAppearance_textColor from the TextView_textAppearance attribute, if TextView_textColor was not set directly. | ||||||
final | ColorStateList | getTextColors() | ||||
Return the set of text colors. | ||||||
static | ColorStateList | getTextColors(Context context, TypedArray attrs) | ||||
Returns the TextView_textColor attribute from the Resources.StyledAttributes, if set, or the TextAppearance_textColor from the TextView_textAppearance attribute, if TextView_textColor was not set directly. | ||||||
float | getTextScaleX() | |||||
float | getTextSize() | |||||
int | getTotalPaddingBottom() | |||||
Returns the total bottom padding of the view, including the bottom Drawable if any, the extra space to keep more than maxLines from showing, and the vertical offset for gravity, if any. | ||||||
int | getTotalPaddingLeft() | |||||
Returns the total left padding of the view, including the left Drawable if any. | ||||||
int | getTotalPaddingRight() | |||||
Returns the total right padding of the view, including the right Drawable if any. | ||||||
int | getTotalPaddingTop() | |||||
Returns the total top padding of the view, including the top Drawable if any, the extra space to keep more than maxLines from showing, and the vertical offset for gravity, if any. | ||||||
final | TransformationMethod | getTransformationMethod() | ||||
Typeface | getTypeface() | |||||
URLSpan[] | getUrls() | |||||
Returns the list of URLSpans attached to the text (by Linkify or otherwise) if any. | ||||||
boolean | hasSelection() | |||||
Return true iff there is a selection inside this text view. | ||||||
int | length() | |||||
Returns the length, in characters, of the text managed by this TextView | ||||||
void | onCreateContextMenu(ContextMenu menu) | |||||
Views should implement this if the view itself is going to add items to the context menu. | ||||||
void | onDraw(Canvas canvas) | |||||
Implement this to do your drawing. | ||||||
void | onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) | |||||
Called by the view system when the focus state of this view changes. | ||||||
boolean | onKeyDown(int keyCode, KeyEvent event) | |||||
Default implementation of KeyEvent.Callback.onKeyMultiple(): perform press of the view when KEYCODE_DPAD_CENTER or KEYCODE_ENTER is released, if the view is enabled and clickable. | ||||||
boolean | onKeyShortcut(int keyCode, KeyEvent event) | |||||
Called when an unhandled key shortcut event occurs. | ||||||
boolean | onKeyUp(int keyCode, KeyEvent event) | |||||
Default implementation of KeyEvent.Callback.onKeyMultiple(): perform clicking of the view when KEYCODE_DPAD_CENTER or KEYCODE_ENTER is released. | ||||||
void | onMeasure(int widthMeasureSpec, int heightMeasureSpec) | |||||
Measure the view and its content to determine the measured width and the measured height. |
||||||
boolean | onPreDraw() | |||||
Callback method to be invoked when the view tree is about to be drawn. | ||||||
void | onRestoreInstanceState(Parcelable state) | |||||
Hook allowing a view to re-apply a representation of its internal state that had previously been generated by onSaveInstanceState(). | ||||||
Parcelable | 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. | ||||||
void | onTextChanged(CharSequence text, int start, int before, int after) | |||||
This method is called when the text is changed, in case any subclasses would like to know. | ||||||
boolean | onTouchEvent(MotionEvent event) | |||||
Implement this method to handle touch screen motion events. | ||||||
boolean | onTrackballEvent(MotionEvent event) | |||||
Implement this method to handle trackball motion events. | ||||||
void | onWindowFocusChanged(boolean hasWindowFocus) | |||||
Called when the window containing this view gains or loses focus. | ||||||
boolean | performLongClick() | |||||
Call this view's OnLongClickListener, if it is defined. | ||||||
void | removeTextChangedListener(TextWatcher watcher) | |||||
Removes the specified TextWatcher from the list of those whose methods are called whenever this TextView's text changes. | ||||||
final | void | setAutoLinkMask(int mask) | ||||
Sets the autolink mask of the text. | ||||||
void | setCompoundDrawablePadding(int pad) | |||||
Sets the size of the padding between the compound drawables and the text. | ||||||
void | setCompoundDrawables(Drawable left, Drawable top, Drawable right, Drawable bottom) | |||||
Sets the Drawables (if any) to appear to the left of, above, to the right of, and below the text. | ||||||
void | setCompoundDrawablesWithIntrinsicBounds(Drawable left, Drawable top, Drawable right, Drawable bottom) | |||||
Sets the Drawables (if any) to appear to the left of, above, to the right of, and below the text. | ||||||
void | setCursorVisible(boolean visible) | |||||
Set whether the cursor is visible. | ||||||
final | void | setEditableFactory(Editable.Factory factory) | ||||
Sets the Factory used to create new Editables. | ||||||
void | setEllipsize(TextUtils.TruncateAt where) | |||||
Causes words in the text that are longer than the view is wide to be ellipsized instead of broken in the middle. | ||||||
void | setEms(int ems) | |||||
Makes the TextView exactly this many ems wide | ||||||
void | setError(CharSequence error) | |||||
Sets the right-hand compound drawable of the TextView to the "error" icon and sets an error message that will be displayed in a popup when the TextView has focus. | ||||||
void | setError(CharSequence error, Drawable icon) | |||||
Sets the right-hand compound drawable of the TextView to the specified icon and sets an error message that will be displayed in a popup when the TextView has focus. | ||||||
void | setFilters(InputFilter[] filters) | |||||
Sets the list of input filters that will be used if the buffer is Editable. | ||||||
boolean | setFrame(int l, int t, int r, int b) | |||||
Assign a size and position to this view. | ||||||
void | setFreezesText(boolean freezesText) | |||||
Control whether this text view saves its entire text contents when freezing to an icicle, in addition to dynamic state such as cursor position. | ||||||
void | setGravity(int gravity) | |||||
Sets the horizontal alignment of the text and the vertical gravity that will be used when there is extra space in the TextView beyond what is required for the text itself. | ||||||
void | setHeight(int pixels) | |||||
Makes the TextView exactly this many pixels tall. | ||||||
void | setHighlightColor(int color) | |||||
Sets the color used to display the selection highlight. | ||||||
final | void | setHint(CharSequence hint) | ||||
Sets the text to be displayed when the text of the TextView is empty. | ||||||
final | void | setHint(int resid) | ||||
Sets the text to be displayed when the text of the TextView is empty, from a resource. | ||||||
final | void | setHintTextColor(ColorStateList colors) | ||||
Sets the color of the hint text. | ||||||
final | void | setHintTextColor(int color) | ||||
Sets the color of the hint text. | ||||||
void | setHorizontallyScrolling(boolean whether) | |||||
Sets whether the text should be allowed to be wider than the View is. | ||||||
void | setIncludeFontPadding(boolean includepad) | |||||
Set whether the TextView includes extra top and bottom padding to make room for accents that go above the normal ascent and descent. | ||||||
void | setKeyListener(KeyListener input) | |||||
Sets the key listener to be used with this TextView. | ||||||
void | setLineSpacing(float add, float mult) | |||||
Sets line spacing for this TextView. | ||||||
void | setLines(int lines) | |||||
Makes the TextView exactly this many lines tall | ||||||
final | void | setLinkTextColor(ColorStateList colors) | ||||
Sets the color of links in the text. | ||||||
final | void | setLinkTextColor(int color) | ||||
Sets the color of links in the text. | ||||||
final | void | setLinksClickable(boolean whether) | ||||
Sets whether the movement method will automatically be set to LinkMovementMethod if setAutoLinkMask(int) has been set to nonzero and links are detected in setText(char[], int, int). | ||||||
void | setMaxEms(int maxems) | |||||
Makes the TextView at most this many ems wide | ||||||
void | setMaxHeight(int maxHeight) | |||||
Makes the TextView at most this many pixels tall | ||||||
void | setMaxLines(int maxlines) | |||||
Makes the TextView at most this many lines tall | ||||||
void | setMaxWidth(int maxpixels) | |||||
Makes the TextView at most this many pixels wide | ||||||
void | setMinEms(int minems) | |||||
Makes the TextView at least this many ems wide | ||||||
void | setMinHeight(int minHeight) | |||||
Makes the TextView at least this many pixels tall | ||||||
void | setMinLines(int minlines) | |||||
Makes the TextView at least this many lines tall | ||||||
void | setMinWidth(int minpixels) | |||||
Makes the TextView at least this many pixels wide | ||||||
final | void | setMovementMethod(MovementMethod movement) | ||||
Sets the movement method (arrow key handler) to be used for this TextView. | ||||||
void | setPadding(int left, int top, int right, int bottom) | |||||
Sets the padding. | ||||||
void | setPaintFlags(int flags) | |||||
Sets flags on the Paint being used to display the text and reflows the text if they are different from the old flags. | ||||||
void | setScroller(Scroller s) | |||||
void | setSelectAllOnFocus(boolean selectAllOnFocus) | |||||
Set the TextView so that when it takes focus, all the text is selected. | ||||||
void | setShadowLayer(float radius, float dx, float dy, int color) | |||||
Gives the text a shadow of the specified radius and color, the specified distance from its normal position. | ||||||
void | setSingleLine() | |||||
Sets the properties of this field (lines, horizontally scrolling, transformation method) to be for a single-line input. | ||||||
void | setSingleLine(boolean singleLine) | |||||
If true, sets the properties of this field (lines, horizontally scrolling, transformation method) to be for a single-line input; if false, restores these to the default conditions. | ||||||
final | void | setSpannableFactory(Spannable.Factory factory) | ||||
Sets the Factory used to create new Spannables. | ||||||
final | void | setText(int resid) | ||||
final | void | setText(int resid, TextView.BufferType type) | ||||
final | void | setText(char[] text, int start, int len) | ||||
Sets the TextView to display the specified slice of the specified char array. | ||||||
void | setText(CharSequence text, TextView.BufferType type) | |||||
Sets the text that this TextView is to display (see setText(CharSequence)) and also sets whether it is stored in a styleable/spannable buffer and whether it is editable. | ||||||
final | void | setText(CharSequence text) | ||||
Sets the string value of the TextView. | ||||||
void | setTextAppearance(Context context, int resid) | |||||
Sets the text color, size, style, hint color, and highlight color from the specified TextAppearance resource. | ||||||
void | setTextColor(int color) | |||||
Sets the text color for all the states (normal, selected, focused) to be this color. | ||||||
void | setTextColor(ColorStateList colors) | |||||
Sets the text color. | ||||||
final | void | setTextKeepState(CharSequence text) | ||||
Like setText(CharSequence), except that the cursor position (if any) is retained in the new text. | ||||||
final | void | setTextKeepState(CharSequence text, TextView.BufferType type) | ||||
Like setText(CharSequence, android.widget.TextView.BufferType), except that the cursor position (if any) is retained in the new text. | ||||||
void | setTextScaleX(float size) | |||||
Sets the extent by which text should be stretched horizontally. | ||||||
void | setTextSize(int unit, float size) | |||||
Set the default text size to a given unit and value. | ||||||
void | setTextSize(float size) | |||||
Set the default text size to the given value, interpreted as "scaled pixel" units. | ||||||
final | void | setTransformationMethod(TransformationMethod method) | ||||
Sets the transformation that is applied to the text that this TextView is displaying. | ||||||
void | setTypeface(Typeface tf, int style) | |||||
Sets the typeface and style in which the text should be displayed, and turns on the fake bold and italic bits in the Paint if the Typeface that you provided does not have all the bits in the style that you specified. | ||||||
void | setTypeface(Typeface tf) | |||||
Sets the typeface and style in which the text should be displayed. | ||||||
void | setWidth(int pixels) | |||||
Makes the TextView exactly this many pixels wide. |
void | addFocusables(ArrayList<View> views, int direction) | |||||
Add any focusable views that are descendants of this view (possibly including this view if it is focusable itself) to views. | ||||||
void | addTouchables(ArrayList<View> views) | |||||
Add any touchable views that are descendants of this view (possibly including this view if it is touchable itself) to views. | ||||||
void | bringToFront() | |||||
Change the view's z order in the tree, so it's on top of other sibling views | ||||||
void | buildDrawingCache() | |||||
Forces the drawing cache to be built if the drawing cache is invalid. |
||||||
void | cancelLongPress() | |||||
Cancels a pending long press. | ||||||
void | clearAnimation() | |||||
Cancels any animations for this view. | ||||||
void | clearFocus() | |||||
Called when this view wants to give up focus. | ||||||
int | computeHorizontalScrollExtent() | |||||
Compute the horizontal extent of the horizontal scrollbar's thumb within the horizontal range. |
||||||
int | computeHorizontalScrollOffset() | |||||
Compute the horizontal offset of the horizontal scrollbar's thumb within the horizontal range. |
||||||
int | computeHorizontalScrollRange() | |||||
Compute the horizontal range that the horizontal scrollbar represents. |
||||||
void | computeScroll() | |||||
Called by a parent to request that a child update its values for mScrollX and mScrollY if necessary. | ||||||
int | computeVerticalScrollExtent() | |||||
Compute the vertical extent of the horizontal scrollbar's thumb within the vertical range. |
||||||
int | computeVerticalScrollOffset() | |||||
Compute the vertical offset of the vertical scrollbar's thumb within the horizontal range. |
||||||
int | computeVerticalScrollRange() | |||||
Compute the vertical range that the vertical scrollbar represents. |
||||||
void | createContextMenu(ContextMenu menu) | |||||
Show the context menu for this view. | ||||||
void | destroyDrawingCache() | |||||
Frees the resources used by the drawing cache. |
||||||
void | dispatchDraw(Canvas canvas) | |||||
Called by draw to draw the child views. | ||||||
boolean | dispatchKeyEvent(KeyEvent event) | |||||
Dispatch a key event to the next view on the focus path. | ||||||
boolean | dispatchKeyShortcutEvent(KeyEvent event) | |||||
Dispatches a key shortcut event. | ||||||
void | dispatchRestoreInstanceState(SparseArray<Parcelable> container) | |||||
Called by restoreHierarchyState(SparseArray |
||||||
void | dispatchSaveInstanceState(SparseArray<Parcelable> container) | |||||
Called by saveHierarchyState(SparseArray |
||||||
void | dispatchSetPressed(boolean pressed) | |||||
Dispatch setPressed to all of this View's children. | ||||||
void | dispatchSetSelected(boolean selected) | |||||
Dispatch setSelected to all of this View's children. | ||||||
boolean | dispatchTouchEvent(MotionEvent event) | |||||
Pass the touch screen motion event down to the target view, or this view if it is the target. | ||||||
boolean | dispatchTrackballEvent(MotionEvent event) | |||||
Pass a trackball motion event down to the focused view. | ||||||
boolean | dispatchUnhandledMove(View focused, int direction) | |||||
This method is the last chance for the focused view and its ancestors to respond to an arrow key. | ||||||
void | dispatchWindowFocusChanged(boolean hasFocus) | |||||
Called when the window containing this view gains or loses window focus. | ||||||
void | dispatchWindowVisibilityChanged(int visibility) | |||||
Dispatch a window visibility change down the view hierarchy. | ||||||
void | draw(Canvas canvas) | |||||
Manually render this view (and all of its children) to the given Canvas. | ||||||
void | drawableStateChanged() | |||||
This function is called whenever the state of the view changes in such a way that it impacts the state of drawables being shown. | ||||||
void | finalize() | |||||
Called by the virtual machine when there are no longer any (non-weak) references to the receiver. | ||||||
View | findFocus() | |||||
Find the view in the hierarchy rooted at this view that currently has focus. | ||||||
final | View | findViewById(int id) | ||||
Look for a child view with the given id. | ||||||
final | View | findViewWithTag(Object tag) | ||||
Look for a child view with the given tag. | ||||||
boolean | fitSystemWindows(Rect insets) | |||||
Apply the insets for system windows to this view, if the FITS_SYSTEM_WINDOWS flag is set | ||||||
View | focusSearch(int direction) | |||||
Find the nearest view in the specified direction that can take focus. | ||||||
void | forceLayout() | |||||
Forces this view to be laid out during the next layout pass. | ||||||
Animation | getAnimation() | |||||
Get the animation currently associated with this view. | ||||||
Drawable | getBackground() | |||||
Gets the background drawable | ||||||
int | getBaseline() | |||||
Return the offset of the widget's text baseline from the widget's top boundary. |
||||||
final | int | getBottom() | ||||
Bottom position of this view relative to its parent. | ||||||
float | getBottomFadingEdgeStrength() | |||||
Returns the strength, or intensity, of the bottom faded edge. | ||||||
final | Context | getContext() | ||||
Returns the context the view is running in, through which it can access the current theme, resources, etc. | ||||||
ContextMenu.ContextMenuInfo | getContextMenuInfo() | |||||
Views should implement this if they have extra information to associate with the context menu. | ||||||
static | int | getDefaultSize(int size, int measureSpec) | ||||
Utility to return a default size. | ||||||
final | int[] | getDrawableState() | ||||
Return an array of resource IDs of the drawable states representing the current state of the view. | ||||||
Bitmap | getDrawingCache() | |||||
Returns the bitmap in which this view drawing is cached. |
||||||
int | getDrawingCacheBackgroundColor() | |||||
int | getDrawingCacheQuality() | |||||
Returns the quality of the drawing cache. | ||||||
void | getDrawingRect(Rect outRect) | |||||
Return the visible drawing bounds of your view. | ||||||
long | getDrawingTime() | |||||
Return the time at which the drawing of the view hierarchy started. |
||||||
ArrayList<View> | getFocusables(int direction) | |||||
Find and return all focusable views that are descendants of this view, possibly including this view if it is focusable itself. | ||||||
void | getFocusedRect(Rect r) | |||||
When a view has focus and the user navigates away from it, the next view is searched for starting from the rectangle filled in by this method. | ||||||
boolean | getGlobalVisibleRect(Rect r, Point globalOffset) | |||||
If some part of this view is not clipped by any of its parents, then return that area in r in global (root) coordinates. | ||||||
final | boolean | getGlobalVisibleRect(Rect r) | ||||
Handler | getHandler() | |||||
final | int | getHeight() | ||||
Return the height of your view. | ||||||
void | getHitRect(Rect outRect) | |||||
Hit rectangle in parent's coordinates | ||||||
int | getHorizontalFadingEdgeLength() | |||||
Returns the size of the horizontal faded edges used to indicate that more content in this view is visible. | ||||||
int | getHorizontalScrollbarHeight() | |||||
Returns the height of the horizontal scrollbar. | ||||||
int | getId() | |||||
Returns this view's identifier. | ||||||
boolean | getKeepScreenOn() | |||||
Returns whether the screen should remain on, corresponding to the current value of KEEP_SCREEN_ON. | ||||||
ViewGroup.LayoutParams | getLayoutParams() | |||||
Get the LayoutParams associated with this view. | ||||||
final | int | getLeft() | ||||
Left position of this view relative to its parent. | ||||||
float | getLeftFadingEdgeStrength() | |||||
Returns the strength, or intensity, of the left faded edge. | ||||||
final | boolean | getLocalVisibleRect(Rect r) | ||||
void | getLocationInWindow(int[] location) | |||||
Computes the coordinates of this view in its window. |
||||||
void | getLocationOnScreen(int[] location) | |||||
Computes the coordinates of this view on the screen. |
||||||
final | int | getMeasuredHeight() | ||||
The height of this view as measured in the most recent call to measure(). | ||||||
final | int | getMeasuredWidth() | ||||
The width of this view as measured in the most recent call to measure(). | ||||||
int | getNextFocusDownId() | |||||
int | getNextFocusLeftId() | |||||
int | getNextFocusRightId() | |||||
int | getNextFocusUpId() | |||||
View.OnFocusChangeListener | getOnFocusChangeListener() | |||||
Returns the focus-change callback registered for this view. | ||||||
int | getPaddingBottom() | |||||
Returns the bottom padding of this view. | ||||||
int | getPaddingLeft() | |||||
Returns the left padding of this view. | ||||||
int | getPaddingRight() | |||||
Returns the right padding of this view. | ||||||
int | getPaddingTop() | |||||
Returns the top padding of this view. | ||||||
final | ViewParent | getParent() | ||||
Gets the parent of this view. | ||||||
Resources | getResources() | |||||
Returns the resources associated with this view. | ||||||
final | int | getRight() | ||||
Right position of this view relative to its parent. | ||||||
float | getRightFadingEdgeStrength() | |||||
Returns the strength, or intensity, of the right faded edge. | ||||||
View | getRootView() | |||||
Finds the topmost view in the current view hierarchy. |
||||||
int | getScrollBarStyle() | |||||
Returns the current scrollbar style. |
||||||
final | int | getScrollX() | ||||
Return the scrolled left position of this view. | ||||||
final | int | getScrollY() | ||||
Return the scrolled top position of this view. | ||||||
int | getSolidColor() | |||||
Override this if your view is known to always be drawn on top of a solid color background, and needs to draw fading edges. | ||||||
int | getSuggestedMinimumHeight() | |||||
Returns the suggested minimum height that the view should use. | ||||||
int | getSuggestedMinimumWidth() | |||||
Returns the suggested minimum width that the view should use. | ||||||
Object | getTag() | |||||
Returns this view's tag. | ||||||
final | int | getTop() | ||||
Top position of this view relative to its parent. | ||||||
float | getTopFadingEdgeStrength() | |||||
Returns the strength, or intensity, of the top faded edge. | ||||||
TouchDelegate | getTouchDelegate() | |||||
Gets the TouchDelegate for this View. | ||||||
ArrayList<View> | getTouchables() | |||||
Find and return all touchable views that are descendants of this view, possibly including this view if it is touchable itself. | ||||||
int | getVerticalFadingEdgeLength() | |||||
Returns the size of the vertical faded edges used to indicate that more content in this view is visible. | ||||||
int | getVerticalScrollbarWidth() | |||||
Returns the width of the vertical scrollbar. | ||||||
ViewTreeObserver | getViewTreeObserver() | |||||
Returns the ViewTreeObserver for this view's hierarchy. | ||||||
int | getVisibility() | |||||
Returns the visibility status for this view. | ||||||
final | int | getWidth() | ||||
Return the width of the your view. | ||||||
int | getWindowAttachCount() | |||||
IBinder | getWindowToken() | |||||
Retrieve a unique token identifying the window this view is attached to. | ||||||
int | getWindowVisibility() | |||||
Returns the current visibility of the window this view is attached to (either GONE, INVISIBLE, or VISIBLE). | ||||||
boolean | hasFocus() | |||||
Returns true if this view has focus iteself, or is the ancestor of the view that has focus. | ||||||
boolean | hasFocusable() | |||||
Returns true if this view is focusable or if it contains a reachable View for which hasFocusable() returns true. | ||||||
boolean | hasWindowFocus() | |||||
Returns true if this view is in a window that currently has window focus. | ||||||
static | View | inflate(Context context, int resource, ViewGroup root) | ||||
Inflate a view from an XML resource. | ||||||
void | initializeFadingEdge(TypedArray a) | |||||
Initializes the fading edges from a given set of styled attributes. |
||||||
void | initializeScrollbars(TypedArray a) | |||||
Initializes the scrollbars from a given set of styled attributes. |
||||||
void | invalidate(int l, int t, int r, int b) | |||||
Mark the the area defined by the rect (l,t,r,b) as needing to be drawn. | ||||||
void | invalidate() | |||||
Invalidate the whole view. | ||||||
void | invalidate(Rect dirty) | |||||
Mark the the area defined by dirty as needing to be drawn. | ||||||
void | invalidateDrawable(Drawable drawable) | |||||
Invalidates the specified Drawable. | ||||||
boolean | isClickable() | |||||
Indicates whether this view reacts to click events or not. | ||||||
boolean | isDrawingCacheEnabled() | |||||
Indicates whether the drawing cache is enabled for this view. |
||||||
boolean | isDuplicateParentStateEnabled() | |||||
Indicates whether this duplicates its drawable state from its parent. |
||||||
boolean | isEnabled() | |||||
Returns the enabled status for this view. | ||||||
final | boolean | isFocusable() | ||||
Returns whether this View is able to take focus. | ||||||
final | boolean | isFocusableInTouchMode() | ||||
When a view is focusable, it may not want to take focus when in touch mode. | ||||||
boolean | isFocused() | |||||
Returns true if this view has focus | ||||||
boolean | isHorizontalFadingEdgeEnabled() | |||||
Indicate whether the horizontal edges are faded when the view is scrolled horizontally. |
||||||
boolean | isHorizontalScrollBarEnabled() | |||||
Indicate whether the horizontal scrollbar should be drawn or not. |
||||||
boolean | isInTouchMode() | |||||
Returns whether the device is currently in touch mode. | ||||||
boolean | isLayoutRequested() | |||||
Indicates whether or not this view's layout will be requested during the next hierarchy layout pass. |
||||||
boolean | isLongClickable() | |||||
Indicates whether this view reacts to long click events or not. | ||||||
boolean | isPressed() | |||||
Indicates whether the view is currently in pressed state. | ||||||
boolean | isSaveEnabled() | |||||
Indicates whether this view will save its state (that is, whether its onSaveInstanceState() method will be called). | ||||||
boolean | isSelected() | |||||
Indicates the selection state of this view. | ||||||
boolean | isShown() | |||||
Returns the visibility of this view and all of its ancestors | ||||||
boolean | isVerticalFadingEdgeEnabled() | |||||
Indicate whether the vertical edges are faded when the view is scrolled horizontally. |
||||||
boolean | isVerticalScrollBarEnabled() | |||||
Indicate whether the vertical scrollbar should be drawn or not. |
||||||
final | void | layout(int l, int t, int r, int b) | ||||
Assign a size and position to a view and all of its
descendants
This is the second phase of the layout mechanism. |
||||||
final | void | measure(int widthMeasureSpec, int heightMeasureSpec) | ||||
This is called to find out how big a view should be. |
||||||
static | int[] | mergeDrawableStates(int[] baseState, int[] additionalState) | ||||
Merge your own state values in additionalState into the base state values baseState that were returned by onCreateDrawableState(int). | ||||||
void | onAnimationEnd() | |||||
Invoked by a parent ViewGroup to notify the end of the animation currently associated with this view. | ||||||
void | onAnimationStart() | |||||
Invoked by a parent ViewGroup to notify the start of the animation currently associated with this view. | ||||||
void | onAttachedToWindow() | |||||
This is called when the view is attached to a window. | ||||||
void | onCreateContextMenu(ContextMenu menu) | |||||
Views should implement this if the view itself is going to add items to the context menu. | ||||||
int[] | onCreateDrawableState(int extraSpace) | |||||
Generate the new Drawable state for this view. | ||||||
void | onDetachedFromWindow() | |||||
This is called when the view is detached from a window. | ||||||
void | onDraw(Canvas canvas) | |||||
Implement this to do your drawing. | ||||||
void | onFinishInflate() | |||||
Finalize inflating a view from XML. | ||||||
void | onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) | |||||
Called by the view system when the focus state of this view changes. | ||||||
boolean | onKeyDown(int keyCode, KeyEvent event) | |||||
Default implementation of KeyEvent.Callback.onKeyMultiple(): perform press of the view when KEYCODE_DPAD_CENTER or KEYCODE_ENTER is released, if the view is enabled and clickable. | ||||||
boolean | onKeyMultiple(int keyCode, int repeatCount, KeyEvent event) | |||||
Default implementation of KeyEvent.Callback.onKeyMultiple(): always returns false (doesn't handle the event). | ||||||
boolean | onKeyShortcut(int keyCode, KeyEvent event) | |||||
Called when an unhandled key shortcut event occurs. | ||||||
boolean | onKeyUp(int keyCode, KeyEvent event) | |||||
Default implementation of KeyEvent.Callback.onKeyMultiple(): perform clicking of the view when KEYCODE_DPAD_CENTER or KEYCODE_ENTER is released. | ||||||
void | onLayout(boolean changed, int left, int top, int right, int bottom) | |||||
Called from layout when this view should assign a size and position to each of its children. | ||||||
void | onMeasure(int widthMeasureSpec, int heightMeasureSpec) | |||||
Measure the view and its content to determine the measured width and the measured height. |
||||||
void | onRestoreInstanceState(Parcelable state) | |||||
Hook allowing a view to re-apply a representation of its internal state that had previously been generated by onSaveInstanceState(). | ||||||
Parcelable | 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. | ||||||
void | onScrollChanged(int l, int t, int oldl, int oldt) | |||||
This is called in response to an internal scroll in this view (i.e., the view scrolled its own contents). | ||||||
boolean | onSetAlpha(int alpha) | |||||
Invoked if there is a Transform that involves alpha. | ||||||
void | onSizeChanged(int w, int h, int oldw, int oldh) | |||||
This is called during layout when the size of this view has changed. | ||||||
boolean | onTouchEvent(MotionEvent event) | |||||
Implement this method to handle touch screen motion events. | ||||||
boolean | onTrackballEvent(MotionEvent event) | |||||
Implement this method to handle trackball motion events. | ||||||
void | onWindowFocusChanged(boolean hasWindowFocus) | |||||
Called when the window containing this view gains or loses focus. | ||||||
void | onWindowVisibilityChanged(int visibility) | |||||
Called when the window containing has change its visibility (between GONE, INVISIBLE, and VISIBLE). | ||||||
boolean | performClick() | |||||
Call this view's OnClickListener, if it is defined. | ||||||
boolean | performLongClick() | |||||
Call this view's OnLongClickListener, if it is defined. | ||||||
boolean | post(Runnable action) | |||||
Causes the Runnable to be added to the message queue. | ||||||
boolean | postDelayed(Runnable action, long delayMillis) | |||||
Causes the Runnable to be added to the message queue, to be run after the specified amount of time elapses. | ||||||
void | postInvalidate() | |||||
Cause an invalidate to happen on a subsequent cycle through the event loop. | ||||||
void | postInvalidate(int left, int top, int right, int bottom) | |||||
Cause an invalidate of the specified area to happen on a subsequent cycle through the event loop. | ||||||
void | postInvalidateDelayed(long delayMilliseconds) | |||||
Cause an invalidate to happen on a subsequent cycle through the event loop. | ||||||
void | postInvalidateDelayed(long delayMilliseconds, int left, int top, int right, int bottom) | |||||
Cause an invalidate of the specified area to happen on a subsequent cycle through the event loop. | ||||||
void | refreshDrawableState() | |||||
Call this to force a view to update its drawable state. | ||||||
boolean | removeCallbacks(Runnable action) | |||||
Removes the specified Runnable from the message queue. | ||||||
final | boolean | requestFocus() | ||||
Call this to try to give focus to a specific view or to one of its descendants. | ||||||
boolean | requestFocus(int direction, Rect previouslyFocusedRect) | |||||
Call this to try to give focus to a specific view or to one of its descendants and give it hints about the direction and a specific rectangle that the focus is coming from. | ||||||
final | boolean | requestFocus(int direction) | ||||
Call this to try to give focus to a specific view or to one of its descendants and give it a hint about what direction focus is heading. | ||||||
final | boolean | requestFocusFromTouch() | ||||
Call this to try to give focus to a specific view or to one of its descendants. | ||||||
void | requestLayout() | |||||
Call this when something has changed which has invalidated the layout of this view. | ||||||
boolean | requestRectangleOnScreen(Rect rectangle, boolean immediate) | |||||
Request that a rectangle of this view be visible on the screen, scrolling if necessary just enough. | ||||||
boolean | requestRectangleOnScreen(Rect rectangle) | |||||
Request that a rectangle of this view be visible on the screen, scrolling if necessary just enough. | ||||||
static | int | resolveSize(int size, int measureSpec) | ||||
Utility to reconcile a desired size with constraints imposed by a MeasureSpec. | ||||||
void | restoreHierarchyState(SparseArray<Parcelable> container) | |||||
Restore this view hierarchy's frozen state from the given container. | ||||||
void | saveHierarchyState(SparseArray<Parcelable> container) | |||||
Store this view hierarchy's frozen state into the given container. | ||||||
void | scheduleDrawable(Drawable who, Runnable what, long when) | |||||
Schedules an action on a drawable to occur at a specified time. | ||||||
void | scrollBy(int x, int y) | |||||
Move the scrolled position of your view. | ||||||
void | scrollTo(int x, int y) | |||||
Set the scrolled position of your view. | ||||||
void | setAnimation(Animation animation) | |||||
Sets the next animation to play for this view. | ||||||
void | setBackgroundColor(int color) | |||||
Sets the background color for this view. | ||||||
void | setBackgroundDrawable(Drawable d) | |||||
Set the background to a given Drawable, or remove the background. | ||||||
void | setBackgroundResource(int resid) | |||||
Set the background to a given resource. | ||||||
void | setClickable(boolean clickable) | |||||
Enables or disables click events for this view. | ||||||
void | setDrawingCacheBackgroundColor(int color) | |||||
Setting a solid background color for the drawing cache's bitmaps will improve perfromance and memory usage. | ||||||
void | setDrawingCacheEnabled(boolean enabled) | |||||
Enables or disables the drawing cache. |
||||||
void | setDrawingCacheQuality(int quality) | |||||
Set the drawing cache quality of this view. | ||||||
void | setDuplicateParentStateEnabled(boolean enabled) | |||||
Enables or disables the duplication of the parent's state into this view. |
||||||
void | setEnabled(boolean enabled) | |||||
Set the enabled state of this view. | ||||||
void | setFadingEdgeLength(int length) | |||||
Set the size of the faded edge used to indicate that more content in this view is available. | ||||||
void | setFocusable(boolean focusable) | |||||
Set whether this view can receive the focus. | ||||||
void | setFocusableInTouchMode(boolean focusableInTouchMode) | |||||
Set whether this view can receive focus while in touch mode. | ||||||
void | setHorizontalFadingEdgeEnabled(boolean horizontalFadingEdgeEnabled) | |||||
Define whether the horizontal edges should be faded when this view is scrolled horizontally. |
||||||
void | setHorizontalScrollBarEnabled(boolean horizontalScrollBarEnabled) | |||||
Define whether the horizontal scrollbar should be drawn or not. |
||||||
void | setId(int id) | |||||
Sets the identifier for this view. | ||||||
void | setKeepScreenOn(boolean keepScreenOn) | |||||
Controls whether the screen should remain on, modifying the value of KEEP_SCREEN_ON. | ||||||
void | setLayoutParams(ViewGroup.LayoutParams params) | |||||
Set the layout parameters associated with this view. | ||||||
void | setLongClickable(boolean longClickable) | |||||
Enables or disables long click events for this view. | ||||||
final | void | setMeasuredDimension(int measuredWidth, int measuredHeight) | ||||
This mehod must be called by onMeasure(int, int) to store the measured width and measured height. |
||||||
void | setMinimumHeight(int minHeight) | |||||
Sets the minimum height of the view. | ||||||
void | setMinimumWidth(int minWidth) | |||||
Sets the minimum width of the view. | ||||||
void | setNextFocusDownId(int nextFocusDownId) | |||||
Set the id of the view to use for the next focus | ||||||
void | setNextFocusLeftId(int nextFocusLeftId) | |||||
Set the id of the view to use for the next focus | ||||||
void | setNextFocusRightId(int nextFocusRightId) | |||||
Set the id of the view to use for the next focus | ||||||
void | setNextFocusUpId(int nextFocusUpId) | |||||
Set the id of the view to use for the next focus | ||||||
void | setOnClickListener(View.OnClickListener l) | |||||
Register a callback to be invoked when this view is clicked. | ||||||
void | setOnCreateContextMenuListener(View.OnCreateContextMenuListener l) | |||||
Register a callback to be invoked when the context menu for this view is being built. | ||||||
void | setOnFocusChangeListener(View.OnFocusChangeListener l) | |||||
Register a callback to be invoked when focus of this view changed. | ||||||
void | setOnKeyListener(View.OnKeyListener l) | |||||
Register a callback to be invoked when a key is pressed in this view. | ||||||
void | setOnLongClickListener(View.OnLongClickListener l) | |||||
Register a callback to be invoked when this view is clicked and held. | ||||||
void | setOnTouchListener(View.OnTouchListener l) | |||||
Register a callback to be invoked when a touch event is sent to this view. | ||||||
void | setPadding(int left, int top, int right, int bottom) | |||||
Sets the padding. | ||||||
void | setPressed(boolean pressed) | |||||
Sets the pressed that for this view. | ||||||
void | setSaveEnabled(boolean enabled) | |||||
Controls whether the saving of this view's state is enabled (that is, whether its onSaveInstanceState() method will be called). | ||||||
void | setScrollBarStyle(int style) | |||||
Specify the style of the scrollbars. |
||||||
void | setSelected(boolean selected) | |||||
Changes the selection state of this view. | ||||||
void | setTag(Object tag) | |||||
Sets the tag associated with this view. | ||||||
void | setTouchDelegate(TouchDelegate delegate) | |||||
Sets the TouchDelegate for this View. | ||||||
void | setVerticalFadingEdgeEnabled(boolean verticalFadingEdgeEnabled) | |||||
Define whether the vertical edges should be faded when this view is scrolled vertically. |
||||||
void | setVerticalScrollBarEnabled(boolean verticalScrollBarEnabled) | |||||
Define whether the vertical scrollbar should be drawn or not. |
||||||
void | setVisibility(int visibility) | |||||
Set the enabled state of this view. | ||||||
void | setWillNotCacheDrawing(boolean willNotCacheDrawing) | |||||
When a View's drawing cache is enabled, drawing is redirected to an offscreen bitmap. | ||||||
void | setWillNotDraw(boolean willNotDraw) | |||||
If this view doesn't do any drawing on its own, set this flag to allow further optimizations. | ||||||
boolean | showContextMenu() | |||||
Bring up the context menu for this view. | ||||||
void | startAnimation(Animation animation) | |||||
Start the specified animation now. | ||||||
void | unscheduleDrawable(Drawable who, Runnable what) | |||||
Cancels a scheduled action on a drawable. | ||||||
void | unscheduleDrawable(Drawable who) | |||||
Unschedule any events associated with the given Drawable. | ||||||
boolean | verifyDrawable(Drawable who) | |||||
If your view subclass is displaying its own Drawable objects, it should override this function and return true for any Drawable it is displaying. | ||||||
boolean | willNotCacheDrawing() | |||||
Returns whether or not this View can cache its drawing or not. | ||||||
boolean | willNotDraw() | |||||
Returns whether or not this View draws on its own. |
Object | clone() | |||||
Returns a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver. | ||||||
boolean | equals(Object o) | |||||
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. | ||||||
void | finalize() | |||||
Called by the virtual machine when there are no longer any (non-weak) references to the receiver. | ||||||
final | Class<? extends Object> | getClass() | ||||
Returns the unique instance of java.lang.Class which represents the class of the receiver. | ||||||
int | hashCode() | |||||
Returns an integer hash code for the receiver. | ||||||
final | void | notify() | ||||
Causes one thread which is wait ing on the receiver to be
made ready to run. |
||||||
final | void | notifyAll() | ||||
Causes all threads which are wait ing on the receiver to
be made ready to run. |
||||||
String | toString() | |||||
Returns a string containing a concise, human-readable description of the receiver. | ||||||
final | void | wait(long time, int frac) | ||||
Causes the thread which sent this message to be made not ready to run
either pending some change in the receiver (as indicated by
notify or notifyAll ) or the expiration of
the timeout. |
||||||
final | void | wait(long time) | ||||
Causes the thread which sent this message to be made not ready to run
either pending some change in the receiver (as indicated by
notify or notifyAll ) or the expiration of
the timeout. |
||||||
final | void | wait() | ||||
Causes the thread which sent this message to be made not ready to run
pending some change in the receiver (as indicated by notify
or notifyAll ). |
void | invalidateDrawable(Drawable who) | |||||
Called when the drawable needs to be redrawn. | ||||||
void | scheduleDrawable(Drawable who, Runnable what, long when) | |||||
A Drawable can call this to schedule the next frame of its animation. | ||||||
void | unscheduleDrawable(Drawable who, Runnable what) | |||||
A Drawable can call this to unschedule an action previously scheduled with scheduleDrawable(Drawable, Runnable, long). |
boolean | onKeyDown(int keyCode, KeyEvent event) | |||||
Called when a key down event has occurred. | ||||||
boolean | onKeyMultiple(int keyCode, int count, KeyEvent event) | |||||
Called when multiple down/up pairs of the same key have occurred in a row. | ||||||
boolean | onKeyUp(int keyCode, KeyEvent event) | |||||
Called when a key up event has occurred. |
boolean | onPreDraw() | |||||
Callback method to be invoked when the view tree is about to be drawn. |
boolean | isChecked() | |||||
void | setChecked(boolean checked) | |||||
Change the checked state of the view | ||||||
void | toggle() | |||||
Change the checked state of the view to the inverse of its current state |
If the radio button is already checked, this method will not toggle the radio button.
Copyright 2007 Google Inc. | Build 0.9_r1-98467 - 14 Aug 2008 18:48 |