A TextSwitcher is a specialized ViewSwitcher that contains only children of type TextView. A TextSwitcher is useful to animate a label on screen. Whenever setText(CharSequence) is called, TextSwitcher animates the current text out and animates the new text in.
Attribute name | Related methods | |
---|---|---|
android:foreground | setForeground(Drawable) |
Defines the drawable to draw over the content. |
android:foregroundGravity | setForegroundGravity(int) |
Defines the gravity to apply to the foreground drawable. |
android:measureAllChildren | setMeasureAllChildren(boolean) |
Determines whether to measure all children or just those in the VISIBLE or INVISIBLE state when measuring. |
Attribute name | Related methods | |
---|---|---|
android:clipChildren | setClipChildren(boolean) |
Defines whether a child is limited to draw inside of its bounds or not. |
android:clipToPadding | setClipToPadding(boolean) |
Defines whether the ViewGroup will clip its drawing surface so as to exclude the padding area. |
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 | CLIP_TO_PADDING_MASK | We clip to padding when FLAG_CLIP_TO_PADDING and FLAG_PADDING_NOT_NULL are set at the same time. | 34 | 0x00000022 |
int | FLAG_SUPPORT_STATIC_TRANSFORMATIONS | When set, this ViewGroup supports static transformations on children; this causes getChildStaticTransformation(View, android.view.animation.Transformation) to be invoked when a child is drawn. | 2048 | 0x00000800 |
int | FLAG_USE_CHILD_DRAWING_ORDER | When set, the drawing method will call getChildDrawingOrder(int, int) to get the index of the child to draw for that iteration. | 1024 | 0x00000400 |
int | FOCUS_AFTER_DESCENDANTS | This view will get focus only if none of its descendants want it. | 262144 | 0x00040000 |
int | FOCUS_BEFORE_DESCENDANTS | This view will get focus before any of its descendants. | 131072 | 0x00020000 |
int | FOCUS_BLOCK_DESCENDANTS | This view will block any of its descendants from getting focus, even if they are focusable. | 393216 | 0x00060000 |
int | PERSISTENT_ALL_CACHES | Used to indicate that all drawing caches should be kept in memory. | 3 | 0x00000003 |
int | PERSISTENT_ANIMATION_CACHE | Used to indicate that the animation drawing cache should be kept in memory. | 1 | 0x00000001 |
int | PERSISTENT_NO_CACHE | Used to indicate that no drawing cache should be kept in memory. | 0 | 0x00000000 |
int | PERSISTENT_SCROLLING_CACHE | Used to indicate that the scrolling drawing cache should be kept in memory. | 2 | 0x00000002 |
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 | ArrayList<View> | mDisappearingChildren | Views which have been hidden or removed which need to be animated on their way out | ||
protected | int | mGroupFlags | |||
protected | ViewGroup.OnHierarchyChangeListener | mOnHierarchyChangeListener | Listener used to propagate events indicating when children are added and/or removed from a view group. | ||
protected | int | mPersistentDrawingCache | Indicates which types of drawing caches are to be kept in memory. |
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. |
TextSwitcher(Context context) | ||||||
Creates a new empty TextSwitcher. | ||||||
TextSwitcher(Context context, AttributeSet attrs) | ||||||
Creates a new empty TextSwitcher for the given context and with the specified set attributes. |
void | addView(View child, int index, ViewGroup.LayoutParams params) | |||||
Adds a child view with the specified layout parameters. | ||||||
void | setCurrentText(CharSequence text) | |||||
Sets the text of the text view that is currently showing. | ||||||
void | setText(CharSequence text) | |||||
Sets the text of the next view and switches to the next view. |
void | addView(View child, int index, ViewGroup.LayoutParams params) | |||||
Adds a child view with the specified layout parameters. | ||||||
View | getNextView() | |||||
Returns the next view to be displayed. | ||||||
void | reset() | |||||
Reset the ViewSwitcher to hide all of the existing views and to make it think that the first time animation has not yet played. | ||||||
void | setFactory(ViewSwitcher.ViewFactory factory) | |||||
Sets the factory used to create the two views between which the ViewSwitcher will flip. |
void | addView(View child, int index, ViewGroup.LayoutParams params) | |||||
Adds a child view with the specified layout parameters. | ||||||
int | getBaseline() | |||||
Return the offset of the widget's text baseline from the widget's top boundary. |
||||||
View | getCurrentView() | |||||
Returns the View corresponding to the currently displayed child. | ||||||
int | getDisplayedChild() | |||||
Returns the index of the currently displayed child view. | ||||||
Animation | getInAnimation() | |||||
Returns the current animation used to animate a View that enters the screen. | ||||||
Animation | getOutAnimation() | |||||
Returns the current animation used to animate a View that exits the screen. | ||||||
void | setAnimateFirstView(boolean animate) | |||||
Indicates whether the current View should be animated the first time the ViewAnimation is displayed. | ||||||
void | setDisplayedChild(int whichChild) | |||||
Sets which child view will be displayed. | ||||||
void | setInAnimation(Animation inAnimation) | |||||
Specifies the animation used to animate a View that enters the screen. | ||||||
void | setInAnimation(Context context, int resourceID) | |||||
Specifies the animation used to animate a View that enters the screen. | ||||||
void | setOutAnimation(Animation outAnimation) | |||||
Specifies the animation used to animate a View that exit the screen. | ||||||
void | setOutAnimation(Context context, int resourceID) | |||||
Specifies the animation used to animate a View that exit the screen. | ||||||
void | showNext() | |||||
Manually shows the next child. | ||||||
void | showPrevious() | |||||
Manually shows the previous child. |
boolean | checkLayoutParams(ViewGroup.LayoutParams p) | |||||
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. | ||||||
boolean | gatherTransparentRegion(Region region) | |||||
This is used by the RootView to perform an optimization when the view hierarchy contains one or several SurfaceView. | ||||||
FrameLayout.LayoutParams | generateDefaultLayoutParams() | |||||
Returns a set of layout parameters with a width of FILL_PARENT, and a height of FILL_PARENT. | ||||||
ViewGroup.LayoutParams | generateLayoutParams(ViewGroup.LayoutParams p) | |||||
Returns a safe set of layout parameters based on the supplied layout params. | ||||||
FrameLayout.LayoutParams | generateLayoutParams(AttributeSet attrs) | |||||
Returns a new set of layout parameters based on the supplied attributes set. | ||||||
boolean | getConsiderGoneChildrenWhenMeasuring() | |||||
Determines whether to measure all children or just those in the VISIBLE or INVISIBLE state when measuring. | ||||||
Drawable | getForeground() | |||||
Returns the drawable used as the foreground of this FrameLayout. | ||||||
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 | onSizeChanged(int w, int h, int oldw, int oldh) | |||||
This is called during layout when the size of this view has changed. | ||||||
void | setForeground(Drawable drawable) | |||||
Supply a Drawable that is to be rendered on top of all of the child views in the frame layout. | ||||||
void | setForegroundGravity(int foregroundGravity) | |||||
Describes how the foreground is positioned. | ||||||
void | setMeasureAllChildren(boolean measureAll) | |||||
Determines whether to measure all children or just those in the VISIBLE or INVISIBLE state when measuring. | ||||||
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. |
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. | ||||||
boolean | addStatesFromChildren() | |||||
Returns whether this ViewGroup's drawable states also include its children's drawable states. | ||||||
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 | addView(View child, int index) | |||||
Adds a child view. | ||||||
void | addView(View child, int width, int height) | |||||
Adds a child view with this ViewGroup's default layout parameters and the specified width and height. | ||||||
void | addView(View child, ViewGroup.LayoutParams params) | |||||
Adds a child view with the specified layout parameters. | ||||||
void | addView(View child, int index, ViewGroup.LayoutParams params) | |||||
Adds a child view with the specified layout parameters. | ||||||
void | addView(View child) | |||||
Adds a child view. | ||||||
boolean | addViewInLayout(View child, int index, ViewGroup.LayoutParams params) | |||||
Adds a view during layout. | ||||||
boolean | addViewInLayout(View child, int index, ViewGroup.LayoutParams params, boolean preventRequestLayout) | |||||
Adds a view during layout. | ||||||
void | attachLayoutAnimationParameters(View child, ViewGroup.LayoutParams params, int index, int count) | |||||
Subclasses should override this method to set layout animation parameters on the supplied child. | ||||||
void | attachViewToParent(View child, int index, ViewGroup.LayoutParams params) | |||||
Attaches a view to this view group. | ||||||
void | bringChildToFront(View child) | |||||
Change the z order of the child so it's on top of all other children | ||||||
boolean | canAnimate() | |||||
Indicates whether the view group has the ability to animate its children after the first layout. | ||||||
boolean | checkLayoutParams(ViewGroup.LayoutParams p) | |||||
void | childDrawableStateChanged(View child) | |||||
If {link #addStatesFromChildren} is true, refreshes this group's drawable state (to include the states from its children). | ||||||
void | cleanupLayoutState(View child) | |||||
Prevents the specified child to be laid out during the next layout pass. | ||||||
void | clearChildFocus(View child) | |||||
Called when a child of this parent is giving up focus | ||||||
void | clearDisappearingChildren() | |||||
Removes any pending animations for views that have been removed. | ||||||
void | clearFocus() | |||||
Called when this view wants to give up focus. | ||||||
void | debug(int depth) | |||||
Prints information about this view in the log output, with the tag VIEW_LOG_TAG. | ||||||
void | detachAllViewsFromParent() | |||||
Detaches all views from theparent. | ||||||
void | detachViewFromParent(View child) | |||||
Detaches a view from its parent. | ||||||
void | detachViewFromParent(int index) | |||||
Detaches a view from its parent. | ||||||
void | detachViewsFromParent(int start, int count) | |||||
Detaches a range of view from their parent. | ||||||
void | dispatchDraw(Canvas canvas) | |||||
Called by draw to draw the child views. | ||||||
void | dispatchFreezeSelfOnly(SparseArray<Parcelable> container) | |||||
Perform dispatching of a freeze() to only this view, not to its children. | ||||||
boolean | dispatchKeyEvent(KeyEvent event) | |||||
Dispatch a key event to the next view on the focus path. | ||||||
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. | ||||||
void | dispatchThawSelfOnly(SparseArray<Parcelable> container) | |||||
Perform dispatching of a thaw() to only this view, not to its children. | ||||||
boolean | dispatchTouchEvent(MotionEvent ev) | |||||
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. | ||||||
boolean | drawChild(Canvas canvas, View child, long drawingTime) | |||||
Draw one child of this View Group. | ||||||
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. | ||||||
View | findFocus() | |||||
Find the view in the hierarchy rooted at this view that currently has focus. | ||||||
boolean | fitSystemWindows(Rect insets) | |||||
Apply the insets for system windows to this view, if the FITS_SYSTEM_WINDOWS flag is set | ||||||
View | focusSearch(View focused, int direction) | |||||
Find the nearest view in the specified direction that wants to take focus. | ||||||
void | focusableViewAvailable(View v) | |||||
Tells the parent that a new focusable view has become available. | ||||||
boolean | gatherTransparentRegion(Region region) | |||||
This is used by the RootView to perform an optimization when the view hierarchy contains one or several SurfaceView. | ||||||
ViewGroup.LayoutParams | generateDefaultLayoutParams() | |||||
Returns a set of default layout parameters. | ||||||
ViewGroup.LayoutParams | generateLayoutParams(ViewGroup.LayoutParams p) | |||||
Returns a safe set of layout parameters based on the supplied layout params. | ||||||
ViewGroup.LayoutParams | generateLayoutParams(AttributeSet attrs) | |||||
Returns a new set of layout parameters based on the supplied attributes set. | ||||||
View | getChildAt(int index) | |||||
Returns the view at the specified position in the group. | ||||||
int | getChildCount() | |||||
Returns the number of children in the group. | ||||||
int | getChildDrawingOrder(int childCount, int i) | |||||
Returns the index of the child to draw for this iteration. | ||||||
static | int | getChildMeasureSpec(int spec, int padding, int childDimension) | ||||
Does the hard part of measureChildren: figuring out the MeasureSpec to pass to a particular child. | ||||||
boolean | getChildStaticTransformation(View child, Transformation t) | |||||
boolean | getChildVisibleRect(View child, Rect r, Point offset) | |||||
int | getDescendantFocusability() | |||||
Gets the descendant focusability of this view group. | ||||||
View | getFocusedChild() | |||||
Returns the focused child of this view, if any. | ||||||
LayoutAnimationController | getLayoutAnimation() | |||||
Returns the layout animation controller used to animate the group's children. | ||||||
Animation.AnimationListener | getLayoutAnimationListener() | |||||
Returns the animation listener to which layout animation events are sent. | ||||||
int | getPersistentDrawingCache() | |||||
Returns an integer indicating what types of drawing caches are kept in memory. | ||||||
boolean | hasFocus() | |||||
Returns true if this view has or contains focus | ||||||
boolean | hasFocusable() | |||||
Returns true if this view is focusable or if it contains a reachable View for which hasFocusable() returns true. | ||||||
int | indexOfChild(View child) | |||||
Returns the position in the group of the specified child view. | ||||||
final | void | invalidateChild(View child, Rect dirty) | ||||
Don't call or override this method. | ||||||
ViewParent | invalidateChildInParent(int[] location, Rect dirty) | |||||
Don't call or override this method. | ||||||
boolean | isAlwaysDrawnWithCacheEnabled() | |||||
Indicates whether this ViewGroup will always try to draw its children using their drawing cache. | ||||||
boolean | isAnimationCacheEnabled() | |||||
Indicates whether the children's drawing cache is used during a layout animation. | ||||||
boolean | isChildrenDrawnWithCacheEnabled() | |||||
Indicates whether the ViewGroup is currently drawing its children using their drawing cache. | ||||||
void | measureChild(View child, int parentWidthMeasureSpec, int parentHeightMeasureSpec) | |||||
Ask one of the children of this view to measure itself, taking into account both the MeasureSpec requirements for this view and its padding. | ||||||
void | measureChildWithMargins(View child, int parentWidthMeasureSpec, int widthUsed, int parentHeightMeasureSpec, int heightUsed) | |||||
Ask one of the children of this view to measure itself, taking into account both the MeasureSpec requirements for this view and its padding and margins. | ||||||
void | measureChildren(int widthMeasureSpec, int heightMeasureSpec) | |||||
Ask all of the children of this view to measure themselves, taking into account both the MeasureSpec requirements for this view and its padding. | ||||||
final | void | offsetDescendantRectToMyCoords(View descendant, Rect rect) | ||||
Offset a rectangle that is in a descendant's coordinate space into our coordinate space. | ||||||
final | void | offsetRectIntoDescendantCoords(View descendant, Rect rect) | ||||
Offset a rectangle that is in our coordinate space into an ancestor's coordinate space. | ||||||
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. | ||||||
int[] | onCreateDrawableState(int extraSpace) | |||||
Generate the new Drawable state for this view. | ||||||
boolean | onInterceptTouchEvent(MotionEvent ev) | |||||
Implement this method to intercept all touch screen motion events. | ||||||
abstract | void | onLayout(boolean changed, int l, int t, int r, int b) | ||||
Called from layout when this view should assign a size and position to each of its children. | ||||||
boolean | onRequestFocusInDescendants(int direction, Rect previouslyFocusedRect) | |||||
Look for a descendant to call requestFocus() on. | ||||||
void | recomputeViewAttributes(View child) | |||||
Tell view hierarchy that the global view attributes need to be re-evaluated. | ||||||
void | removeAllViews() | |||||
Call this method to remove all child views from the ViewGroup. | ||||||
void | removeAllViewsInLayout() | |||||
Called by a ViewGroup subclass to remove child views from itself, when it must first know its size on screen before it can calculate how many child views it will render. | ||||||
void | removeDetachedView(View child, boolean animate) | |||||
Finishes the removal of a detached view. | ||||||
void | removeView(View view) | |||||
void | removeViewAt(int index) | |||||
Removes the view at the specified position in the group. | ||||||
void | removeViewInLayout(View view) | |||||
Removes a view during layout. | ||||||
void | removeViews(int start, int count) | |||||
Removes the specified range of views from the group. | ||||||
void | removeViewsInLayout(int start, int count) | |||||
Removes a range of views during layout. | ||||||
void | requestChildFocus(View child, View focused) | |||||
Called when a child of this parent wants focus | ||||||
boolean | requestChildRectangleOnScreen(View child, Rect rectangle, boolean immediate) | |||||
Called when a child of this group wants a particular rectangle to be positioned onto the screen. | ||||||
void | requestDisallowInterceptTouchEvent(boolean disallowIntercept) | |||||
Called when a child does not want this parent and its ancestors to intercept touch events with onInterceptTouchEvent(MotionEvent). | ||||||
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. Looks for a view to give focus to respecting the setting specified by getDescendantFocusability(). | ||||||
void | requestTransparentRegion(View child) | |||||
Called when a child wants the view hierarchy to gather and report transparent regions to the window compositor. | ||||||
void | scheduleLayoutAnimation() | |||||
Schedules the layout animation to be played after the next layout pass of this view group. | ||||||
void | setAddStatesFromChildren(boolean addsStates) | |||||
Sets whether this ViewGroup's drawable states also include its children's drawable states. | ||||||
void | setAlwaysDrawnWithCacheEnabled(boolean always) | |||||
Indicates whether this ViewGroup will always try to draw its children using their drawing cache. | ||||||
void | setAnimationCacheEnabled(boolean enabled) | |||||
Enables or disables the children's drawing cache during a layout animation. | ||||||
void | setChildrenDrawingCacheEnabled(boolean enabled) | |||||
Enables or disables the drawing cache for each child of this view group. | ||||||
void | setChildrenDrawnWithCacheEnabled(boolean enabled) | |||||
Tells the ViewGroup to draw its children using their drawing cache. | ||||||
void | setClipChildren(boolean clipChildren) | |||||
By default, children are clipped to their bounds before drawing. | ||||||
void | setClipToPadding(boolean clipToPadding) | |||||
By default, children are clipped to the padding of the ViewGroup. | ||||||
void | setDescendantFocusability(int focusability) | |||||
Set the descendant focusability of this view group. | ||||||
void | setLayoutAnimation(LayoutAnimationController controller) | |||||
Sets the layout animation controller used to animate the group's children after the first layout. | ||||||
void | setLayoutAnimationListener(Animation.AnimationListener animationListener) | |||||
Specifies the animation listener to which layout animation events must be sent. | ||||||
void | setOnHierarchyChangeListener(ViewGroup.OnHierarchyChangeListener listener) | |||||
Register a callback to be invoked when a child is added to or removed from this view. | ||||||
void | setPadding(int left, int top, int right, int bottom) | |||||
Sets the padding. | ||||||
void | setPersistentDrawingCache(int drawingCacheToKeep) | |||||
Indicates what types of drawing caches should be kept in memory after they have been created. | ||||||
boolean | showContextMenuForChild(View originalView) | |||||
Bring up a context menu for the specified view or its ancestors. | ||||||
void | startLayoutAnimation() | |||||
Runs the layout animation. | ||||||
void | updateViewLayout(View view, ViewGroup.LayoutParams params) | |||||
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. |
void | addView(View view, ViewGroup.LayoutParams params) | |||||
void | removeView(View view) | |||||
void | updateViewLayout(View view, ViewGroup.LayoutParams params) |
void | bringChildToFront(View child) | |||||
Change the z order of the child so it's on top of all other children | ||||||
void | childDrawableStateChanged(View child) | |||||
This method is called on the parent when a child's drawable state has changed. | ||||||
void | clearChildFocus(View child) | |||||
Called when a child of this parent is giving up focus | ||||||
void | createContextMenu(ContextMenu menu) | |||||
Have the parent populate the specified context menu if it has anything to add (and then recurse on its parent). | ||||||
View | focusSearch(View v, int direction) | |||||
Find the nearest view in the specified direction that wants to take focus | ||||||
void | focusableViewAvailable(View v) | |||||
Tells the parent that a new focusable view has become available. | ||||||
boolean | getChildVisibleRect(View child, Rect r, Point offset) | |||||
ViewParent | getParent() | |||||
Returns the parent if it exists, or null. | ||||||
void | invalidateChild(View child, Rect r) | |||||
All or part of a child is dirty and needs to be redrawn. | ||||||
ViewParent | invalidateChildInParent(int[] location, Rect r) | |||||
All or part of a child is dirty and needs to be redrawn. | ||||||
boolean | isLayoutRequested() | |||||
Indicates whether layout was requested on this view parent. | ||||||
void | recomputeViewAttributes(View child) | |||||
Tell view hierarchy that the global view attributes need to be re-evaluated. | ||||||
void | requestChildFocus(View child, View focused) | |||||
Called when a child of this parent wants focus | ||||||
void | requestDisallowInterceptTouchEvent(boolean disallowIntercept) | |||||
Called when a child does not want this parent and its ancestors to intercept touch events with onInterceptTouchEvent(MotionEvent). | ||||||
void | requestLayout() | |||||
Called when something has changed which has invalidated the layout of a child of this view parent. | ||||||
void | requestTransparentRegion(View child) | |||||
Called when a child wants the view hierarchy to gather and report transparent regions to the window compositor. | ||||||
boolean | showContextMenuForChild(View originalView) | |||||
Bring up a context menu for the specified view or its ancestors. |
context | the application's environment |
---|
context | the application environment |
---|---|
attrs | a collection of attributes |
child | the child view to add |
---|---|
index | the position at which to add the child |
params | the layout parameters to set on the child |
IllegalArgumentException | if child is not an instance of TextView |
---|
text | the new text to display |
---|
text | the new text to display |
---|
Copyright 2007 Google Inc. | Build 0.9_r1-98467 - 14 Aug 2008 18:48 |