-
public abstract class RecyclerView.SmoothScrollerBase class for smooth scrolling. Handles basic tracking of the target view position andprovides methods to trigger a programmatic scroll.
An instance of SmoothScroller is only intended to be used once. You should create a newinstance for each call to startSmoothScroll.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classRecyclerView.SmoothScroller.ActionHolds information about a smooth scroll request by a SmoothScroller.
public interfaceRecyclerView.SmoothScroller.ScrollVectorProviderAn interface which is optionally implemented by custom LayoutManager to provide a hint to a SmoothScroller about the location of the target position.
-
Constructor Summary
Constructors Constructor Description RecyclerView.SmoothScroller()
-
Method Summary
Modifier and Type Method Description voidsetTargetPosition(int targetPosition)PointFcomputeScrollVectorForPosition(int targetPosition)Compute the scroll vector for a given target position. RecyclerView.LayoutManagergetLayoutManager()booleanisPendingInitialRun()Returns true if SmoothScroller has been started but has not received the firstanimationcallback yet. booleanisRunning()intgetTargetPosition()Returns the adapter position of the target item intgetChildPosition(View view)intgetChildCount()ViewfindViewByPosition(int position)voidinstantScrollToPosition(int position)-
-
Method Detail
-
setTargetPosition
void setTargetPosition(int targetPosition)
-
computeScrollVectorForPosition
@Nullable() PointF computeScrollVectorForPosition(int targetPosition)
Compute the scroll vector for a given target position.
This method can return null if the layout manager cannot calculate a scroll vectorfor the given position (e.g. it has no current scroll position).
- Parameters:
targetPosition- the position to which the scroller is scrolling
-
getLayoutManager
@Nullable() RecyclerView.LayoutManager getLayoutManager()
-
isPendingInitialRun
boolean isPendingInitialRun()
Returns true if SmoothScroller has been started but has not received the firstanimationcallback yet.
-
isRunning
boolean isRunning()
-
getTargetPosition
int getTargetPosition()
Returns the adapter position of the target item
-
getChildPosition
int getChildPosition(View view)
-
getChildCount
int getChildCount()
-
findViewByPosition
View findViewByPosition(int position)
-
instantScrollToPosition
@Deprecated() void instantScrollToPosition(int position)
-
-
-
-