-
- All Implemented Interfaces:
-
eu.davidea.fastscroller.FastScroller.AdapterInterface,eu.davidea.fastscroller.FastScroller.BubbleTextCreator,eu.davidea.fastscroller.FastScroller.OnScrollStateChangeListener
public abstract class AnimatorAdapter extends SelectableAdapter
This class is responsible to animate items. Bounded items are animated initially and also when user starts to scroll the list.
Animations can be customized for each items applying different logic based on item position and beyond.
This class is extended by FlexibleAdapter.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanonlyEntryAnimation
-
Method Summary
Modifier and Type Method Description AnimatorAdaptersetOnlyEntryAnimation(boolean enabled)Performs only entry animation during the initial loading. AnimatorAdaptersetAnimationInitialDelay(long initialDelay)Sets the initial delay for the first item animation. AnimatorAdaptersetAnimationDelay(long delay)Sets the step delay between an animation and the next to be added to the initial delay. AnimatorAdaptersetAnimationEntryStep(boolean entryStep)If initial loading animation should use step delay between an item animation and the next.When false, all items are animated with no delay. AnimatorAdaptersetAnimationDuration(long duration)Sets the duration of the animation for ALL items. AnimatorAdaptersetAnimationInterpolator(@NonNull() Interpolator interpolator)Sets a custom interpolator for ALL items. AnimatorAdaptersetAnimationOnForwardScrolling(boolean enabled)Enables/Disables item animation while forward scrolling and on loading. booleanisAnimationOnForwardScrollingEnabled()AnimatorAdaptersetAnimationOnReverseScrolling(boolean enabled)Enables/Disables reverse scrolling animation. booleanisAnimationOnReverseScrollingEnabled()booleanisOnlyEntryAnimation()abstract booleanisScrollableHeaderOrFooter(int position)Checks if at the provided position, the item is a Header or Footer. -
Methods inherited from class eu.davidea.flexibleadapter.SelectableAdapter
addSelection, clearSelection, enableLogs, getAllBoundViewHolders, getFastScroller, getFlexibleLayoutManager, getMode, getRecyclerView, getSelectedItemCount, getSelectedPositions, getSelectedPositionsAsSet, isFastScrollerEnabled, isLastItemInActionMode, isSelectAll, isSelectable, isSelected, onAttachedToRecyclerView, onBindViewHolder, onCreateBubbleText, onDetachedFromRecyclerView, onFastScrollerStateChange, onRestoreInstanceState, onSaveInstanceState, onViewRecycled, removeSelection, selectAll, setFastScroller, setFlexibleLayoutManager, setMode, toggleFastScroller, toggleSelection, useTag -
Methods inherited from class androidx.recyclerview.widget.RecyclerView.Adapter
bindViewHolder, createViewHolder, findRelativeAdapterPositionIn, getItemCount, getItemId, getItemViewType, getStateRestorationPolicy, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onAttachedToRecyclerView, onBindViewHolder, onCreateViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewAttachedToWindow, onViewDetachedFromWindow, onViewRecycled, registerAdapterDataObserver, setHasStableIds, setStateRestorationPolicy, unregisterAdapterDataObserver -
Methods inherited from class eu.davidea.fastscroller.FastScroller.AdapterInterface
setFastScroller -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
setOnlyEntryAnimation
AnimatorAdapter setOnlyEntryAnimation(boolean enabled)
Performs only entry animation during the initial loading. Stops the animation afterthe last visible item in the RecyclerView has been animated.
Note: Loading animation can only be performed if the Adapter is initializedwith some items using the Constructor.
Default value is{@code false}.- Parameters:
enabled- true to perform only entry animation, false otherwise
-
setAnimationInitialDelay
AnimatorAdapter setAnimationInitialDelay(long initialDelay)
Sets the initial delay for the first item animation.
Default value is
{@code 0ms}.- Parameters:
initialDelay- any non negative delay
-
setAnimationDelay
AnimatorAdapter setAnimationDelay(long delay)
Sets the step delay between an animation and the next to be added to the initial delay.
The delay is added on top of the previous delay.
Default value is{@code 100ms}.- Parameters:
delay- any positive delay
-
setAnimationEntryStep
AnimatorAdapter setAnimationEntryStep(boolean entryStep)
If initial loading animation should use step delay between an item animation and the next.When false, all items are animated with no delay.
Better to disable when using Grid layouts.
Default value is{@code true}.- Parameters:
entryStep- true to enable step delay, false otherwise
-
setAnimationDuration
AnimatorAdapter setAnimationDuration(long duration)
Sets the duration of the animation for ALL items.
Default value is
{@code 300ms}.- Parameters:
duration- any positive time
-
setAnimationInterpolator
AnimatorAdapter setAnimationInterpolator(@NonNull() Interpolator interpolator)
Sets a custom interpolator for ALL items.
Default value is LinearInterpolator.
- Parameters:
interpolator- any valid non null interpolator
-
setAnimationOnForwardScrolling
AnimatorAdapter setAnimationOnForwardScrolling(boolean enabled)
Enables/Disables item animation while forward scrolling and on loading.Enabling forward scrolling will disable
{@code onlyEntryAnimation}.Forward scrolling is independent from reverse scrolling.Default value is
Note: Loading animation can only be performed if the Adapter is initializedwith some items using the constructor.{@code false}.- Parameters:
enabled- true to enable item animation on forward scrolling, false to disable.
-
isAnimationOnForwardScrollingEnabled
boolean isAnimationOnForwardScrollingEnabled()
-
setAnimationOnReverseScrolling
AnimatorAdapter setAnimationOnReverseScrolling(boolean enabled)
Enables/Disables reverse scrolling animation.Reverse scrolling is independent from forward scrolling.
Default value is
{@code false}(only forward).- Parameters:
enabled- true to enable item animation on reverse scrolling, false to disable.
-
isAnimationOnReverseScrollingEnabled
boolean isAnimationOnReverseScrollingEnabled()
-
isOnlyEntryAnimation
boolean isOnlyEntryAnimation()
-
isScrollableHeaderOrFooter
abstract boolean isScrollableHeaderOrFooter(int position)
Checks if at the provided position, the item is a Header or Footer.
- Parameters:
position- the position to check
-
-
-
-