FileDocCategorySizeDatePackage
ViewFlipper.javaAPI DocAndroid 1.5 API3006Wed May 06 22:41:56 BST 2009android.widget

ViewFlipper

public class ViewFlipper extends ViewAnimator
Simple {@link ViewAnimator} that will animate between two or more views that have been added to it. Only one child is shown at a time. If requested, can automatically flip between each child at a regular interval.
attr
ref android.R.styleable#ViewFlipper_flipInterval

Fields Summary
private int
mFlipInterval
private boolean
mKeepFlipping
private final int
FLIP_MSG
private final android.os.Handler
mHandler
Constructors Summary
public ViewFlipper(android.content.Context context)


       
        super(context);
    
public ViewFlipper(android.content.Context context, android.util.AttributeSet attrs)

        super(context, attrs);

        TypedArray a = context.obtainStyledAttributes(attrs,
                com.android.internal.R.styleable.ViewFlipper);
        mFlipInterval = a.getInt(com.android.internal.R.styleable.ViewFlipper_flipInterval,
                3000);
        a.recycle();
    
Methods Summary
public booleanisFlipping()
Returns true if the child views are flipping.

        return mKeepFlipping;
    
public voidsetFlipInterval(int milliseconds)
How long to wait before flipping to the next view

param
milliseconds time in milliseconds

        mFlipInterval = milliseconds;
    
public voidstartFlipping()
Start a timer to cycle through child views

        if (!mKeepFlipping) {
            mKeepFlipping = true;
            showOnly(mWhichChild);
            Message msg = mHandler.obtainMessage(FLIP_MSG);
            mHandler.sendMessageDelayed(msg, mFlipInterval);
        }
    
public voidstopFlipping()
No more flips

        mKeepFlipping = false;