DefaultItemAnimator
open class DefaultItemAnimator : SimpleItemAnimator
This implementation of RecyclerView.ItemAnimator
provides basic animations on remove, add, and move events that happen to the items in a RecyclerView. RecyclerView uses a DefaultItemAnimator by default.
Summary
Inherited constants |
From class ItemAnimator
Int |
FLAG_APPEARED_IN_PRE_LAYOUT
This ViewHolder was not laid out but has been added to the layout in pre-layout state by the LayoutManager . This means that the item was already in the Adapter but invisible and it may become visible in the post layout phase. LayoutManagers may prefer to add new items in pre-layout to specify their virtual location when they are invisible (e.g. to specify the item should animate in from below the visible area).
|
Int |
FLAG_CHANGED
The Item represented by this ViewHolder is updated.
|
Int |
FLAG_INVALIDATED
Adapter Adapter#notifyDataSetChanged() has been called and the content represented by this ViewHolder is invalid.
|
Int |
FLAG_MOVED
The position of the Item represented by this ViewHolder has been changed. This flag is not bound to Adapter#notifyItemMoved(int, int) . It might be set in response to any adapter change that may have a side effect on this item. (e.g. The item before this one has been removed from the Adapter).
|
Int |
FLAG_REMOVED
The Item represented by this ViewHolder is removed from the adapter.
|
|
Public constructors |
This implementation of RecyclerView.ItemAnimator provides basic animations on remove, add, and move events that happen to the items in a RecyclerView.
|
Public methods |
open Boolean |
|
open Boolean |
|
open Boolean |
|
open Boolean |
|
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).
|
open Unit |
|
open Unit |
|
open Boolean |
|
open Unit |
|
Inherited functions |
From class SimpleItemAnimator
Boolean |
animateAppearance(@NonNull viewHolder: RecyclerView.ViewHolder, @Nullable preLayoutInfo: RecyclerView.ItemAnimator.ItemHolderInfo?, @NonNull postLayoutInfo: RecyclerView.ItemAnimator.ItemHolderInfo)
|
Boolean |
animateChange(@NonNull oldHolder: RecyclerView.ViewHolder, @NonNull newHolder: RecyclerView.ViewHolder, @NonNull preInfo: RecyclerView.ItemAnimator.ItemHolderInfo, @NonNull postInfo: RecyclerView.ItemAnimator.ItemHolderInfo)
|
Boolean |
animateDisappearance(@NonNull viewHolder: RecyclerView.ViewHolder, @NonNull preLayoutInfo: RecyclerView.ItemAnimator.ItemHolderInfo, @Nullable postLayoutInfo: RecyclerView.ItemAnimator.ItemHolderInfo?)
|
Boolean |
animatePersistence(@NonNull viewHolder: RecyclerView.ViewHolder, @NonNull preInfo: RecyclerView.ItemAnimator.ItemHolderInfo, @NonNull postInfo: RecyclerView.ItemAnimator.ItemHolderInfo)
|
Boolean |
canReuseUpdatedViewHolder(@NonNull viewHolder: RecyclerView.ViewHolder)
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).
Note that this method will only be called if the ViewHolder still has the same type (Adapter#getItemViewType(int) ). Otherwise, ItemAnimator will always receive both ViewHolder s in the animateChange(ViewHolder, ViewHolder, ItemHolderInfo, ItemHolderInfo) method.
If your application is using change payloads, you can override canReuseUpdatedViewHolder(ViewHolder, List) to decide based on payloads.
|
Unit |
dispatchAddFinished(item: RecyclerView.ViewHolder!)
Method to be called by subclasses when an add animation is done.
|
Unit |
dispatchAddStarting(item: RecyclerView.ViewHolder!)
Method to be called by subclasses when an add animation is being started.
|
Unit |
dispatchChangeFinished(item: RecyclerView.ViewHolder!, oldItem: Boolean)
Method to be called by subclasses when a change animation is done.
|
Unit |
dispatchChangeStarting(item: RecyclerView.ViewHolder!, oldItem: Boolean)
Method to be called by subclasses when a change animation is being started.
|
Unit |
dispatchMoveFinished(item: RecyclerView.ViewHolder!)
Method to be called by subclasses when a move animation is done.
|
Unit |
dispatchMoveStarting(item: RecyclerView.ViewHolder!)
Method to be called by subclasses when a move animation is being started.
|
Unit |
dispatchRemoveFinished(item: RecyclerView.ViewHolder!)
Method to be called by subclasses when a remove animation is done.
|
Unit | |