Skip to content

Most visited

Recently visited

navigation
added in version 25.1.0
belongs to Maven artifact com.android.support:recyclerview-v7:27.0.0

RecyclerView.SmoothScroller.ScrollVectorProvider

public static interface RecyclerView.SmoothScroller.ScrollVectorProvider

android.support.v7.widget.RecyclerView.SmoothScroller.ScrollVectorProvider
Known Indirect Subclasses


An interface which is optionally implemented by custom RecyclerView.LayoutManager to provide a hint to a RecyclerView.SmoothScroller about the location of the target position.

Summary

Public methods

abstract PointF computeScrollVectorForPosition(int targetPosition)

Should calculate the vector that points to the direction where the target position can be found.

Public methods

computeScrollVectorForPosition

added in version 25.1.0
PointF computeScrollVectorForPosition (int targetPosition)

Should calculate the vector that points to the direction where the target position can be found.

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.

Parameters
targetPosition int: the target position to which the returned vector should point

Returns
PointF the scroll vector for a given position.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)