to top
Android APIs
public class

AdapterViewFlipper

extends AdapterViewAnimator
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.AdapterView<T extends android.widget.Adapter>
         ↳ android.widget.AdapterViewAnimator
           ↳ android.widget.AdapterViewFlipper

Class Overview

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
Attribute Name Related Method Description
android:autoStart When true, automatically start animating

Must be a boolean value, either "true" or "false". 

android:flipInterval setFlipInterval(int)  
[Expand]
Inherited XML Attributes
From class android.widget.AdapterViewAnimator
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Constants
From class android.widget.AdapterView
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
AdapterViewFlipper(Context context)
AdapterViewFlipper(Context context, AttributeSet attrs)
Public Methods
void fyiWillBeAdvancedByHostKThx()
Called by an AppWidgetHost to indicate that it will be automatically advancing the views of this AdapterViewFlipper by calling advance() at some point in the future.
int getFlipInterval()
Returns the flip interval, in milliseconds.
boolean isAutoStart()
Returns true if this view automatically calls startFlipping() when it becomes attached to a window.
boolean isFlipping()
Returns true if the child views are flipping.
void onInitializeAccessibilityEvent(AccessibilityEvent event)
Initializes an AccessibilityEvent with information about this View which is the event source.
void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info)
Initializes an AccessibilityNodeInfo with information about this view.
void setAdapter(Adapter adapter)
Sets the adapter that provides the data and the views to represent the data in this widget.
void setAutoStart(boolean autoStart)
Set if this view automatically calls startFlipping() when it becomes attached to a window.
void setFlipInterval(int flipInterval)
How long to wait before flipping to the next view.
void showNext()
Manually shows the next child.
void showPrevious()
Manually shows the previous child.
void startFlipping()
Start a timer to cycle through child views
void stopFlipping()
No more flips
Protected Methods
void onAttachedToWindow()
This is called when the view is attached to a window.
void onDetachedFromWindow()
This is called when the view is detached from a window.
void onWindowVisibilityChanged(int visibility)
Called when the window containing has change its visibility (between GONE, INVISIBLE, and VISIBLE).
[Expand]
Inherited Methods
From class android.widget.AdapterViewAnimator
From class android.widget.AdapterView
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource
From interface android.widget.Advanceable

XML Attributes

android:autoStart

When true, automatically start animating

Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type.

This corresponds to the global attribute resource symbol autoStart.

Related Methods

android:flipInterval

Related Methods

Public Constructors

public AdapterViewFlipper (Context context)

Added in API level 11

public AdapterViewFlipper (Context context, AttributeSet attrs)

Added in API level 11

Public Methods

public void fyiWillBeAdvancedByHostKThx ()

Added in API level 11

Called by an AppWidgetHost to indicate that it will be automatically advancing the views of this AdapterViewFlipper by calling advance() at some point in the future. This allows AdapterViewFlipper to prepare by no longer Advancing its children.

public int getFlipInterval ()

Added in API level 16

Returns the flip interval, in milliseconds.

Related XML Attributes
Returns
  • the flip interval in milliseconds

public boolean isAutoStart ()

Added in API level 11

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

public boolean isFlipping ()

Added in API level 11

Returns true if the child views are flipping.

public void onInitializeAccessibilityEvent (AccessibilityEvent event)

Added in API level 14

Initializes an AccessibilityEvent with information about this View which is the event source. In other words, the source of an accessibility event is the view whose state change triggered firing the event.

Example: Setting the password property of an event in addition to properties set by the super implementation:

 public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
     super.onInitializeAccessibilityEvent(event);
     event.setPassword(true);
 }

If an View.AccessibilityDelegate has been specified via calling setAccessibilityDelegate(AccessibilityDelegate) its onInitializeAccessibilityEvent(View, AccessibilityEvent) is responsible for handling this call.

Note: Always call the super implementation before adding information to the event, in case the default implementation has basic information to add.

Parameters
event The event to initialize.

public void onInitializeAccessibilityNodeInfo (AccessibilityNodeInfo info)

Added in API level 14

Initializes an AccessibilityNodeInfo with information about this view. The base implementation sets:

Subclasses should override this method, call the super implementation, and set additional attributes.

If an View.AccessibilityDelegate has been specified via calling setAccessibilityDelegate(AccessibilityDelegate) its onInitializeAccessibilityNodeInfo(View, AccessibilityNodeInfo) is responsible for handling this call.

Parameters
info The instance to initialize.

public void setAdapter (Adapter adapter)

Added in API level 11

Sets the adapter that provides the data and the views to represent the data in this widget.

Parameters
adapter The adapter to use to create this view's content.

public void setAutoStart (boolean autoStart)

Added in API level 11

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

public void setFlipInterval (int flipInterval)

Added in API level 11

How long to wait before flipping to the next view.

Related XML Attributes
Parameters
flipInterval flip interval in milliseconds

public void showNext ()

Added in API level 11

Manually shows the next child.

public void showPrevious ()

Added in API level 11

Manually shows the previous child.

public void startFlipping ()

Added in API level 11

Start a timer to cycle through child views

public void stopFlipping ()

Added in API level 11

No more flips

Protected Methods

protected void onAttachedToWindow ()

Added in API level 11

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

protected void onDetachedFromWindow ()

Added in API level 11

This is called when the view is detached from a window. At this point it no longer has a surface for drawing.

protected void onWindowVisibilityChanged (int visibility)

Added in API level 11

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 The new visibility of the window.