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.

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
Called when an item is added to the RecyclerView.
Link copied to clipboard
Called by the RecyclerView when a ViewHolder is added to the layout.
Link copied to clipboard
Called by the RecyclerView when an adapter item is present both before and after the layout and RecyclerView has received a notifyItemChanged call for it.
abstract fun animateChange(oldHolder: RecyclerView.ViewHolder, newHolder: RecyclerView.ViewHolder, fromLeft: Int, fromTop: Int, toLeft: Int, toTop: Int): Boolean
Called when an item is changed in the RecyclerView, as indicated by a call to notifyItemChanged or notifyItemRangeChanged.
Link copied to clipboard
Called by the RecyclerView when a ViewHolder has disappeared from the layout.
Link copied to clipboard
abstract fun animateMove(holder: RecyclerView.ViewHolder, fromX: Int, fromY: Int, toX: Int, toY: Int): Boolean
Called when an item is moved in the RecyclerView.
Link copied to clipboard
Called by the RecyclerView when a ViewHolder is present in both before and after the layout and RecyclerView has not received a notifyItemChanged call for it or a notifyDataSetChanged call.
Link copied to clipboard
Called when an item is removed from the RecyclerView.
Link copied to clipboard
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.
Link copied to clipboard
Method to be called by subclasses when an add animation is done.
Link copied to clipboard
Method to be called by subclasses when an add animation is being started.
Link copied to clipboard
Method to be called by subclasses when a change animation is done.
Link copied to clipboard
Method to be called by subclasses when a change animation is being started.
Link copied to clipboard
Method to be called by subclasses when a move animation is done.
Link copied to clipboard
Method to be called by subclasses when a move animation is being started.
Link copied to clipboard
Method to be called by subclasses when a remove animation is done.
Link copied to clipboard
Method to be called by subclasses when a remove animation is being started.
Link copied to clipboard
Returns whether this ItemAnimator supports animations of change events.
Link copied to clipboard
Called when an add animation has ended on the given ViewHolder.
Link copied to clipboard
Called when an add animation is being started on the given ViewHolder.
Link copied to clipboard
Called when a change animation has ended on the given ViewHolder.
Link copied to clipboard
Called when a change animation is being started on the given ViewHolder.
Link copied to clipboard
Called when a move animation has ended on the given ViewHolder.
Link copied to clipboard
Called when a move animation is being started on the given ViewHolder.
Link copied to clipboard
Called when a remove animation has ended on the given ViewHolder.
Link copied to clipboard
Called when a remove animation is being started on the given ViewHolder.
Link copied to clipboard
open fun setSupportsChangeAnimations(supportsChangeAnimations: Boolean)
Sets whether this ItemAnimator supports animations of item change events.