Added in API level 1

ViewFlipper


open class ViewFlipper : ViewAnimator
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ android.widget.FrameLayout
   ↳ android.widget.ViewAnimator
   ↳ android.widget.ViewFlipper

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

Summary

XML attributes
android:autoStart When true, automatically start animating.
android:flipInterval
Inherited XML attributes
Inherited constants
Public constructors
ViewFlipper(context: Context!)

ViewFlipper(context: Context!, attrs: AttributeSet!)

Public methods
open CharSequence!

Return the class name of this object to be used for accessibility purposes.

open Int

Get the delay before flipping to the next view.

open Boolean

Returns true if this view automatically calls startFlipping() when it becomes attached to a window.

open Boolean

Returns true if the child views are flipping.

open Unit
setAutoStart(autoStart: Boolean)

Set if this view automatically calls startFlipping() when it becomes attached to a window.

open Unit
setFlipInterval(milliseconds: Int)

How long to wait before flipping to the next view

open Unit

Start a timer to cycle through child views

open Unit

No more flips

Protected methods
open Unit

This is called when the view is attached to a window.

open Unit

This is called when the view is detached from a window.

open Unit

Called when the window containing has change its visibility (between GONE, INVISIBLE, and VISIBLE).

Inherited functions
Inherited properties

XML attributes

android:autoStart

android:autoStart
When true, automatically start animating.

May be a boolean value, such as "true" or "false".

android:flipInterval

android:flipInterval

Public constructors

ViewFlipper

Added in API level 1
ViewFlipper(context: Context!)

ViewFlipper

Added in API level 1
ViewFlipper(
    context: Context!,
    attrs: AttributeSet!)

Public methods

getAccessibilityClassName

Added in API level 23
open fun getAccessibilityClassName(): CharSequence!

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

getFlipInterval

Added in API level 29
open fun getFlipInterval(): Int

Get the delay before flipping to the next view.

Return
Int delay time in milliseconds.
Value is 0 or greater

isAutoStart

Added in API level 7
open fun isAutoStart(): Boolean

Returns true if this view automatically calls startFlipping() when it becomes attached to a window.

isFlipping

Added in API level 1
open fun isFlipping(): Boolean

Returns true if the child views are flipping.

setAutoStart

Added in API level 7
open fun setAutoStart(autoStart: Boolean): Unit

Set if this view automatically calls startFlipping() when it becomes attached to a window.

setFlipInterval

Added in API level 1
open fun setFlipInterval(milliseconds: Int): Unit

How long to wait before flipping to the next view

Parameters
milliseconds Int: time in milliseconds.
Value is 0 or greater

startFlipping

Added in API level 1
open fun startFlipping(): Unit

Start a timer to cycle through child views

stopFlipping

Added in API level 1
open fun stopFlipping(): Unit

No more flips

Protected methods

onAttachedToWindow

Added in API level 1
protected open fun onAttachedToWindow(): Unit

This is called when the view is attached to a window. At this point it has a Surface and will start drawing. Note that this function is guaranteed to be called before onDraw(android.graphics.Canvas), however it may be called any time before the first onDraw -- including before or after onMeasure(int,int).
If you override this method you must call through to the superclass implementation.

onDetachedFromWindow

Added in API level 1
protected open fun onDetachedFromWindow(): Unit

This is called when the view is detached from a window. At this point it no longer has a surface for drawing.
If you override this method you must call through to the superclass implementation.

onWindowVisibilityChanged

Added in API level 1
protected open fun onWindowVisibilityChanged(visibility: Int): Unit

Called when the window containing has change its visibility (between GONE, INVISIBLE, and VISIBLE). Note that this tells you whether or not your window is being made visible to the window manager; this does not tell you whether or not your window is obscured by other windows on the screen, even if it is itself visible.

Parameters
visibility Int: The new visibility of the window.
Value is one of the following: