Google is committed to advancing racial equity for Black communities. See how.

SimpleItemAnimator

abstract class SimpleItemAnimator : RecyclerView.ItemAnimator
kotlin.Any
   ↳ androidx.recyclerview.widget.RecyclerView.ItemAnimator
   ↳ androidx.recyclerview.widget.SimpleItemAnimator

A wrapper class for ItemAnimator that records View bounds and decides whether it should run move, change, add or remove animations. This class also replicates the original ItemAnimator API.

It uses RecyclerView.ItemAnimator.ItemHolderInfo to track the bounds information of the Views. If you would like to extend this class, you can override obtainHolderInfo() method to provide your own info class that extends RecyclerView.ItemAnimator.ItemHolderInfo.

Summary

Inherited constants
Public constructors

A wrapper class for ItemAnimator that records View bounds and decides whether it should run move, change, add or remove animations.

Public methods
abstract Boolean

Called when an item is added to the RecyclerView.

open Boolean
animateAppearance(@NonNull viewHolder: RecyclerView.ViewHolder, @Nullable preLayoutInfo: RecyclerView.ItemAnimator.ItemHolderInfo?, @NonNull postLayoutInfo: RecyclerView.ItemAnimator.ItemHolderInfo)

open Boolean

abstract Boolean
animateChange(oldHolder: RecyclerView.ViewHolder!, newHolder: RecyclerView.ViewHolder!, fromLeft: Int, fromTop: Int, toLeft: Int, toTop: Int)

Called when an item is changed in the RecyclerView, as indicated by a call to RecyclerView.Adapter#notifyItemChanged(int) or RecyclerView.Adapter#notifyItemRangeChanged(int, int).

open Boolean

abstract Boolean
animateMove(holder: RecyclerView.ViewHolder!, fromX: Int, fromY: Int, toX: Int, toY: Int)

Called when an item is moved in the RecyclerView.

open Boolean

abstract Boolean

Called when an item is removed from the RecyclerView.

open Boolean

When an item is changed, ItemAnimator can decide whether it wants to re-use the same ViewHolder for animations or RecyclerView should create a copy of the item and ItemAnimator will use both to run the animation (e.g. cross-fade).

Unit

Method to be called by subclasses when an add animation is done.

Unit

Method to be called by subclasses when an add animation is being started.

Unit

Method to be called by subclasses when a change animation is done.

Unit

Method to be called by subclasses when a change animation is being started.

Unit

Method to be called by subclasses when a move animation is done.

Unit

Method to be called by subclasses when a move animation is being started.

Unit

Method to be called by subclasses when a remove animation is done.

Unit

Method to be called by subclasses when a remove animation is being started.

open Boolean

Returns whether this ItemAnimator supports animations of change events.

open Unit

Called when an add animation has ended on the given ViewHolder.

open Unit

Called when an add animation is being started on the given ViewHolder.

open Unit

Called when a change animation has ended on the given ViewHolder.

open Unit

Called when a change animation is being started on the given ViewHolder.

open Unit

Called when a move animation has ended on the given ViewHolder.

open Unit

Called when a move animation is being started on the given ViewHolder.

open Unit

Called when a remove animation has ended on the given ViewHolder.

open Unit

Called when a remove animation is being started on the given ViewHolder.

open Unit
setSupportsChangeAnimations(supportsChangeAnimations: Boolean)

Sets whether this ItemAnimator supports animations of item change events.

Inherited functions