-
public class FlexibleItemAnimator extends 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.
-
-
Constructor Summary
Constructors Constructor Description FlexibleItemAnimator()
-
Method Summary
Modifier and Type Method Description voidsetInterpolator(Interpolator mInterpolator)final voidrunPendingAnimations()final booleananimateRemove(RecyclerView.ViewHolder holder)final booleananimateAdd(RecyclerView.ViewHolder holder)final booleananimateMove(RecyclerView.ViewHolder holder, int fromX, int fromY, int toX, int toY)booleananimateChange(RecyclerView.ViewHolder oldHolder, RecyclerView.ViewHolder newHolder, int fromX, int fromY, int toX, int toY)voidendAnimation(RecyclerView.ViewHolder item)booleanisRunning()voidendAnimations()booleancanReuseUpdatedViewHolder(@NonNull() RecyclerView.ViewHolder viewHolder, @NonNull() List<Object> payloads)If the payload list is not empty, DefaultItemAnimator returns true.-
Methods inherited from class androidx.recyclerview.widget.SimpleItemAnimator
animateAdd, animateAppearance, animateChange, animateDisappearance, animateMove, animatePersistence, animateRemove, canReuseUpdatedViewHolder, dispatchAddFinished, dispatchAddStarting, dispatchChangeFinished, dispatchChangeStarting, dispatchMoveFinished, dispatchMoveStarting, dispatchRemoveFinished, dispatchRemoveStarting, getSupportsChangeAnimations, onAddFinished, onAddStarting, onChangeFinished, onChangeStarting, onMoveFinished, onMoveStarting, onRemoveFinished, onRemoveStarting, setSupportsChangeAnimations -
Methods inherited from class androidx.recyclerview.widget.RecyclerView.ItemAnimator
dispatchAnimationFinished, dispatchAnimationStarted, dispatchAnimationsFinished, endAnimation, endAnimations, getAddDuration, getChangeDuration, getMoveDuration, getRemoveDuration, isRunning, obtainHolderInfo, onAnimationFinished, onAnimationStarted, recordPostLayoutInformation, recordPreLayoutInformation, runPendingAnimations, setAddDuration, setChangeDuration, setMoveDuration, setRemoveDuration -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
setInterpolator
void setInterpolator(Interpolator mInterpolator)
-
runPendingAnimations
final void runPendingAnimations()
-
animateRemove
final boolean animateRemove(RecyclerView.ViewHolder holder)
-
animateAdd
final boolean animateAdd(RecyclerView.ViewHolder holder)
-
animateMove
final boolean animateMove(RecyclerView.ViewHolder holder, int fromX, int fromY, int toX, int toY)
-
animateChange
boolean animateChange(RecyclerView.ViewHolder oldHolder, RecyclerView.ViewHolder newHolder, int fromX, int fromY, int toX, int toY)
-
endAnimation
void endAnimation(RecyclerView.ViewHolder item)
-
isRunning
boolean isRunning()
-
endAnimations
void endAnimations()
-
canReuseUpdatedViewHolder
boolean canReuseUpdatedViewHolder(@NonNull() RecyclerView.ViewHolder viewHolder, @NonNull() List<Object> payloads)
If the payload list is not empty, DefaultItemAnimator returnstrue.When this is the case:- If you override
{@code animateChange()}, both ViewHolder arguments will be the sameinstance. - If you are not overriding
{@code animateChange()}, then DefaultItemAnimator will call{@code animateMove()}and run a move animation instead.
- If you override
-
-
-
-