Added in API level 11

AdapterViewAnimator


abstract class AdapterViewAnimator : AdapterView<Adapter!>, Advanceable
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ android.widget.AdapterView<android.widget.Adapter>
   ↳ android.widget.AdapterViewAnimator

Base class for a AdapterView that will perform animations when switching between its views.

Summary

XML attributes
android:animateFirstView Defines whether to animate the current View when the ViewAnimation is first displayed.
android:inAnimation Identifier for the animation to use when a view is shown.
android:loopViews Defines whether the animator loops to the first view once it has reached the end of the list.
android:outAnimation Identifier for the animation to use when a view is hidden.
Inherited XML attributes
Inherited constants
Public constructors

AdapterViewAnimator(context: Context!, attrs: AttributeSet!, defStyleAttr: Int)

AdapterViewAnimator(context: Context!, attrs: AttributeSet!, defStyleAttr: Int, defStyleRes: Int)

Public methods
open Unit

Called by an android.appwidget.AppWidgetHost in order to advance the current view when it is being used within an app widget.

open Unit

This defers a notifyDataSetChanged on the pending RemoteViewsAdapter if it has not connected yet.

open Unit

Called by an android.appwidget.AppWidgetHost to indicate that it will be automatically advancing the views of this AdapterViewAnimator by calling AdapterViewAnimator.advance() at some point in the future.

open CharSequence!

open Adapter!

open Int

open View!

Returns the View corresponding to the currently displayed child.

open Int

Returns the index of the currently displayed child view.

open ObjectAnimator!

Returns the current animation used to animate a View that enters the screen.

open ObjectAnimator!

Returns the current animation used to animate a View that exits the screen.

open View!

open Boolean

Called back when the adapter connects to the RemoteViewsService.

open Unit

Called back when the adapter disconnects from the RemoteViewsService.

open Unit

open Parcelable?

open Boolean

open Unit
setAdapter(adapter: Adapter!)

open Unit

Indicates whether the current View should be animated the first time the ViewAnimation is displayed.

open Unit
setDisplayedChild(whichChild: Int)

Sets which child view will be displayed.

open Unit

Specifies the animation used to animate a View that enters the screen.

open Unit
setInAnimation(context: Context!, resourceID: Int)

Specifies the animation used to animate a View that enters the screen.

open Unit

Specifies the animation used to animate a View that exit the screen.

open Unit
setOutAnimation(context: Context!, resourceID: Int)

Specifies the animation used to animate a View that exit the screen.

open Unit

Sets up this AdapterViewAnimator to use a remote views adapter which connects to a RemoteViewsService through the specified intent.

open Unit
setSelection(position: Int)

open Unit

Manually shows the next child.

open Unit

Manually shows the previous child.

Protected methods
open Unit
onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int)

open Unit
onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int)

Inherited functions
Inherited properties

XML attributes

android:animateFirstView

android:animateFirstView
Defines whether to animate the current View when the ViewAnimation is first displayed.

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

android:inAnimation

android:inAnimation
Identifier for the animation to use when a view is shown.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

android:loopViews

android:loopViews
Defines whether the animator loops to the first view once it has reached the end of the list.

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

android:outAnimation

android:outAnimation
Identifier for the animation to use when a view is hidden.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

Public constructors

AdapterViewAnimator

Added in API level 11
AdapterViewAnimator(context: Context!)

AdapterViewAnimator

Added in API level 11
AdapterViewAnimator(
    context: Context!,
    attrs: AttributeSet!)

AdapterViewAnimator

Added in API level 14
AdapterViewAnimator(
    context: Context!,
    attrs: AttributeSet!,
    defStyleAttr: Int)

AdapterViewAnimator

Added in API level 21
AdapterViewAnimator(
    context: Context!,
    attrs: AttributeSet!,
    defStyleAttr: Int,
    defStyleRes: Int)

Public methods

advance

Added in API level 11
open fun advance(): Unit

Called by an android.appwidget.AppWidgetHost in order to advance the current view when it is being used within an app widget.

deferNotifyDataSetChanged

Added in API level 14
open fun deferNotifyDataSetChanged(): Unit

This defers a notifyDataSetChanged on the pending RemoteViewsAdapter if it has not connected yet.

fyiWillBeAdvancedByHostKThx

Added in API level 11
open fun fyiWillBeAdvancedByHostKThx(): Unit

Called by an android.appwidget.AppWidgetHost to indicate that it will be automatically advancing the views of this AdapterViewAnimator by calling AdapterViewAnimator.advance() at some point in the future. This allows subclasses to perform any required setup, for example, to stop automatically advancing their children.

getAccessibilityClassName

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

getAdapter

Added in API level 11
open fun getAdapter(): Adapter!
Return
Adapter! The adapter used to provide this view's content.

getBaseline

Added in API level 11
open fun getBaseline(): Int
Return
Int the offset of the baseline within the widget's bounds or -1 if baseline alignment is not supported

getCurrentView

Added in API level 11
open fun getCurrentView(): View!

Returns the View corresponding to the currently displayed child.

Return
View! The View currently displayed.

getDisplayedChild

Added in API level 11
open fun getDisplayedChild(): Int

Returns the index of the currently displayed child view.

getInAnimation

Added in API level 11
open fun getInAnimation(): ObjectAnimator!

Returns the current animation used to animate a View that enters the screen.

Return
ObjectAnimator! An Animation or null if none is set.

getOutAnimation

Added in API level 11
open fun getOutAnimation(): ObjectAnimator!

Returns the current animation used to animate a View that exits the screen.

Return
ObjectAnimator! An Animation or null if none is set.

getSelectedView

Added in API level 11
open fun getSelectedView(): View!
Return
View! The view corresponding to the currently selected item, or null if nothing is selected

onRemoteAdapterConnected

Added in API level 11
open fun onRemoteAdapterConnected(): Boolean

Called back when the adapter connects to the RemoteViewsService.

onRemoteAdapterDisconnected

Added in API level 11
open fun onRemoteAdapterDisconnected(): Unit

Called back when the adapter disconnects from the RemoteViewsService.

onRestoreInstanceState

Added in API level 11
open fun onRestoreInstanceState(state: Parcelable!): Unit
Parameters
state Parcelable!: The frozen state that had previously been returned by onSaveInstanceState.

onSaveInstanceState

Added in API level 11
open fun onSaveInstanceState(): Parcelable?
Return
Parcelable? Returns a Parcelable object containing the view's current dynamic state, or null if there is nothing interesting to save.

onTouchEvent

Added in API level 11
open fun onTouchEvent(ev: MotionEvent!): Boolean
Parameters
event The motion event.
Return
Boolean True if the event was handled, false otherwise.

setAdapter

Added in API level 11
open fun setAdapter(adapter: Adapter!): Unit
Parameters
adapter Adapter!: The adapter to use to create this view's content.

setAnimateFirstView

Added in API level 11
open fun setAnimateFirstView(animate: Boolean): Unit

Indicates whether the current View should be animated the first time the ViewAnimation is displayed.

Parameters
animate Boolean: True to animate the current View the first time it is displayed, false otherwise.

setDisplayedChild

Added in API level 11
open fun setDisplayedChild(whichChild: Int): Unit

Sets which child view will be displayed.

Parameters
whichChild Int: the index of the child view to display

setInAnimation

Added in API level 11
open fun setInAnimation(inAnimation: ObjectAnimator!): Unit

Specifies the animation used to animate a View that enters the screen.

Parameters
inAnimation ObjectAnimator!: The animation started when a View enters the screen.

setInAnimation

Added in API level 11
open fun setInAnimation(
    context: Context!,
    resourceID: Int
): Unit

Specifies the animation used to animate a View that enters the screen.

Parameters
context Context!: The application's environment.
resourceID Int: The resource id of the animation.

setOutAnimation

Added in API level 11
open fun setOutAnimation(outAnimation: ObjectAnimator!): Unit

Specifies the animation used to animate a View that exit the screen.

Parameters
outAnimation ObjectAnimator!: The animation started when a View exit the screen.

setOutAnimation

Added in API level 11
open fun setOutAnimation(
    context: Context!,
    resourceID: Int
): Unit

Specifies the animation used to animate a View that exit the screen.

Parameters
context Context!: The application's environment.
resourceID Int: The resource id of the animation.

setRemoteViewsAdapter

Added in API level 11
open fun setRemoteViewsAdapter(intent: Intent!): Unit

Sets up this AdapterViewAnimator to use a remote views adapter which connects to a RemoteViewsService through the specified intent.

Parameters
intent Intent!: the intent used to identify the RemoteViewsService for the adapter to connect to.

setSelection

Added in API level 11
open fun setSelection(position: Int): Unit
Parameters
position Int: Index (starting at 0) of the data item to be selected.

showNext

Added in API level 11
open fun showNext(): Unit

Manually shows the next child.

showPrevious

Added in API level 11
open fun showPrevious(): Unit

Manually shows the previous child.

Protected methods

onLayout

Added in API level 11
protected open fun onLayout(
    changed: Boolean,
    left: Int,
    top: Int,
    right: Int,
    bottom: Int
): Unit
Parameters
changed Boolean: This is a new size or position for this view
left Int: Left position, relative to parent
top Int: Top position, relative to parent
right Int: Right position, relative to parent
bottom Int: Bottom position, relative to parent

onMeasure

Added in API level 11
protected open fun onMeasure(
    widthMeasureSpec: Int,
    heightMeasureSpec: Int
): Unit
Parameters
widthMeasureSpec Int: horizontal space requirements as imposed by the parent. The requirements are encoded with android.view.View.MeasureSpec.
heightMeasureSpec Int: vertical space requirements as imposed by the parent. The requirements are encoded with android.view.View.MeasureSpec.