AdapterViewFlipper
public
class
AdapterViewFlipper
extends AdapterViewAnimator
| android.widget.AdapterViewAnimator | |
| ↳ | android.widget.AdapterViewFlipper |
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 | |
|---|---|
Public constructors | |
|---|---|
AdapterViewFlipper(Context context)
|
|
AdapterViewFlipper(Context context, AttributeSet attrs)
|
|
AdapterViewFlipper(Context context, AttributeSet attrs, int defStyleAttr)
|
|
AdapterViewFlipper(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
|
|
Public methods | |
|---|---|
void
|
fyiWillBeAdvancedByHostKThx()
Called by an |
CharSequence
|
getAccessibilityClassName()
Return the class name of this object to be used for accessibility purposes. |
int
|
getFlipInterval()
Returns the flip interval, in milliseconds. |
boolean
|
isAutoStart()
Returns true if this view automatically calls |
boolean
|
isFlipping()
Returns true if the child views are flipping. |
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 |
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 |
Inherited methods | |
|---|---|
XML attributes
android:autoStart
When true, automatically start animating.
May be a boolean value, such as "true" or
"false".
android:flipInterval
Related methods:
Public constructors
AdapterViewFlipper
public AdapterViewFlipper (Context context)
| Parameters | |
|---|---|
context |
Context |
AdapterViewFlipper
public AdapterViewFlipper (Context context, AttributeSet attrs)
| Parameters | |
|---|---|
context |
Context |
attrs |
AttributeSet |
AdapterViewFlipper
public AdapterViewFlipper (Context context, AttributeSet attrs, int defStyleAttr)
| Parameters | |
|---|---|
context |
Context |
attrs |
AttributeSet |
defStyleAttr |
int |
AdapterViewFlipper
public AdapterViewFlipper (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
| Parameters | |
|---|---|
context |
Context |
attrs |
AttributeSet |
defStyleAttr |
int |
defStyleRes |
int |
Public methods
fyiWillBeAdvancedByHostKThx
public void fyiWillBeAdvancedByHostKThx ()
Called by an AppWidgetHost to indicate that it will be
automatically advancing the views of this AdapterViewFlipper by calling
AdapterViewFlipper#advance() at some point in the future. This allows
AdapterViewFlipper to prepare by no longer Advancing its children.
getAccessibilityClassName
public CharSequence getAccessibilityClassName ()
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.
| Returns | |
|---|---|
CharSequence |
|
getFlipInterval
public int getFlipInterval ()
Returns the flip interval, in milliseconds.
Related XML Attributes:
| Returns | |
|---|---|
int |
the flip interval in milliseconds |
See also:
isAutoStart
public boolean isAutoStart ()
Returns true if this view automatically calls startFlipping()
when it becomes attached to a window.
| Returns | |
|---|---|
boolean |
|
isFlipping
public boolean isFlipping ()
Returns true if the child views are flipping.
| Returns | |
|---|---|
boolean |
|
setAdapter
public void setAdapter (Adapter adapter)
Sets the adapter that provides the data and the views to represent the data in this widget.
| Parameters | |
|---|---|
adapter |
Adapter: The adapter to use to create this view's content. |
setAutoStart
public void setAutoStart (boolean autoStart)
Set if this view automatically calls startFlipping() when it
becomes attached to a window.
| Parameters | |
|---|---|
autoStart |
boolean |
setFlipInterval
public void setFlipInterval (int flipInterval)
How long to wait before flipping to the next view.
Related XML Attributes:
| Parameters | |
|---|---|
flipInterval |
int: flip interval in milliseconds |
See also:
startFlipping
public void startFlipping ()
Start a timer to cycle through child views
Protected methods
onAttachedToWindow
protected void onAttachedToWindow ()
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
protected void onDetachedFromWindow ()
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
protected void onWindowVisibilityChanged (int visibility)
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 View.VISIBLE, View.INVISIBLE, or View.GONE |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2023-04-12 UTC.