public static interface RecyclerView.SmoothScroller.ScrollVectorProvider
RecyclerView.LayoutManager
to provide a hint to a RecyclerView.SmoothScroller
about the location of the target position.Modifier and Type | Method and Description |
---|---|
PointF |
computeScrollVectorForPosition(int targetPosition)
Should calculate the vector that points to the direction where the target position
can be found.
|
PointF computeScrollVectorForPosition(int targetPosition)
This method is used by the LinearSmoothScroller
to initiate a scroll towards
the target position.
The magnitude of the vector is not important. It is always normalized before being
used by the LinearSmoothScroller
.
LayoutManager should not check whether the position exists in the adapter or not.
targetPosition
- the target position to which the returned vector should point