public abstract class AnimatorAdapter extends SelectableAdapter
Animations can be customized for each items applying different logic based on item position and beyond.
This class is extended byFlexibleAdapter.SelectableAdapter
animateView(RecyclerView.ViewHolder, int) is now automatically called
FlexibleAdapter,
SelectableAdapterSelectableAdapter.ModeisFastScroll, mFastScrollerDelegate, mLastItemInActionMode, mRecyclerView, mSelectAll| Modifier and Type | Method and Description |
|---|---|
protected void |
animateView(RecyclerView.ViewHolder holder,
int position)
Performs checks to scroll animate the itemView and in case, it animates the view.
|
boolean |
isAnimationOnForwardScrollingEnabled() |
boolean |
isAnimationOnReverseScrollingEnabled() |
boolean |
isOnlyEntryAnimation() |
abstract boolean |
isScrollableHeaderOrFooter(int position)
Checks if at the provided position, the item is a Header or Footer.
|
AnimatorAdapter |
setAnimationDelay(long delay)
Sets the step delay between an animation and the next to be added to the initial delay.
|
AnimatorAdapter |
setAnimationDuration(long duration)
Sets the duration of the animation for ALL items.
|
AnimatorAdapter |
setAnimationEntryStep(boolean entryStep)
If initial loading animation should use step delay between an item animation and the next.
|
AnimatorAdapter |
setAnimationInitialDelay(long initialDelay)
Sets the initial delay for the first item animation.
|
AnimatorAdapter |
setAnimationInterpolator(android.view.animation.Interpolator interpolator)
Sets a custom interpolator for ALL items.
|
AnimatorAdapter |
setAnimationOnForwardScrolling(boolean enabled)
Enables/Disables item animation while forward scrolling and on loading.
|
AnimatorAdapter |
setAnimationOnReverseScrolling(boolean enabled)
Enables/Disables reverse scrolling animation.
|
AnimatorAdapter |
setOnlyEntryAnimation(boolean enabled)
Performs only entry animation during the initial loading.
|
addSelection, clearSelection, enableLogs, getAllBoundViewHolders, getFastScroller, getFlexibleLayoutManager, getMode, getRecyclerView, getSelectedItemCount, getSelectedPositions, getSelectedPositionsAsSet, isFastScrollerEnabled, isLastItemInActionMode, isSelectable, isSelectAll, isSelected, onAttachedToRecyclerView, onBindViewHolder, onCreateBubbleText, onDetachedFromRecyclerView, onFastScrollerStateChange, onRestoreInstanceState, onSaveInstanceState, onViewRecycled, removeSelection, selectAll, setFastScroller, setFlexibleLayoutManager, setMode, swapSelection, toggleFastScroller, toggleSelection, useTagpublic AnimatorAdapter setAnimationInitialDelay(long initialDelay)
Default value is 0ms.
initialDelay - any non negative delaypublic AnimatorAdapter setAnimationDelay(long delay)
The delay is added on top of the previous delay.
Default value is100ms.delay - any positive delaypublic AnimatorAdapter setAnimationEntryStep(boolean entryStep)
Better to disable when using Grid layouts.
Default value istrue.entryStep - true to enable step delay, false otherwisepublic AnimatorAdapter setAnimationDuration(long duration)
Default value is 300ms.
duration - any positive timepublic AnimatorAdapter setAnimationInterpolator(android.view.animation.Interpolator interpolator)
Default value is LinearInterpolator.
interpolator - any valid non null interpolatorpublic AnimatorAdapter setAnimationOnForwardScrolling(boolean enabled)
onlyEntryAnimation.
Default value is false.
enabled - true to enable item animation on forward scrolling, false to disable.setOnlyEntryAnimation(boolean),
setAnimationOnReverseScrolling(boolean)public boolean isAnimationOnForwardScrollingEnabled()
public AnimatorAdapter setAnimationOnReverseScrolling(boolean enabled)
Default value is false (only forward).
enabled - true to enable item animation on reverse scrolling, false to disable.setOnlyEntryAnimation(boolean),
setAnimationOnForwardScrolling(boolean)public boolean isAnimationOnReverseScrollingEnabled()
public AnimatorAdapter setOnlyEntryAnimation(boolean enabled)
Note: Loading animation can only be performed if the Adapter is initialized with some items using the Constructor.
Default value isfalse.enabled - true to perform only entry animation, false otherwisesetAnimationOnForwardScrolling(boolean)public boolean isOnlyEntryAnimation()
public abstract boolean isScrollableHeaderOrFooter(int position)
position - the position to checkprotected final void animateView(RecyclerView.ViewHolder holder,
int position)
Note: If you have to change at runtime the LayoutManager and add
Scrollable Headers too, consider to add them in post, using a delay >= 0,
otherwise scroll animations on all items will not start correctly.
holder - the ViewHolder just boundposition - the current item position