English | Site Directory

Android - An Open Handset Alliance Project

android.widget
public class

android.widget.ViewSwitcher

java.lang.Object
android.view.View Drawable.Callback KeyEvent.Callback
android.view.ViewGroup ViewManager ViewParent
android.widget.FrameLayout
android.widget.ViewAnimator
android.widget.ViewSwitcher

Shows only one child at a time. Will automatically flip between children if you ask. A ViewSwitcher can hold only two children at the same time.

Also see ViewGroup.LayoutParams for layout attributes.

Nested Classes
ViewSwitcher.ViewFactory Creates views in a ViewSwitcher. 
Known Direct Subclasses

Summary

XML Attributes inherited from class android.widget.FrameLayout
XML Attributes inherited from class android.view.ViewGroup
XML Attributes inherited from class android.view.View
Constants inherited from class android.view.ViewGroup
Constants inherited from class android.view.View

Fields

protected      ViewFactory  mFactory  The factory used to create the two children. 
Fields inherited from class android.widget.ViewAnimator
Fields inherited from class android.widget.FrameLayout
Fields inherited from class android.view.ViewGroup
Fields inherited from class android.view.View

Public Constructors

          ViewSwitcher(Context context)
Creates a new empty ViewSwitcher.
          ViewSwitcher(Context context, AttributeSet attrs, Map inflateParams)
Creates a new empty ViewSwitcher for the given context and with the specified set attributes.

Public Methods

        void  addView(View child, int index, 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(ViewFactory factory)
Sets the factory used to create the two views between which the ViewSwitcher will flip.
Methods inherited from class android.widget.ViewAnimator
Methods inherited from class android.widget.FrameLayout
Methods inherited from class android.view.ViewGroup