Skip to content

Most visited

Recently visited

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

RecyclerView.OnScrollListener

public static abstract class RecyclerView.OnScrollListener
extends Object

java.lang.Object
   ↳ android.support.v7.widget.RecyclerView.OnScrollListener


An OnScrollListener can be added to a RecyclerView to receive messages when a scrolling event has occurred on that RecyclerView.

See also:

Summary

Public constructors

RecyclerView.OnScrollListener()

Public methods

void onScrollStateChanged(RecyclerView recyclerView, int newState)

Callback method to be invoked when RecyclerView's scroll state changes.

void onScrolled(RecyclerView recyclerView, int dx, int dy)

Callback method to be invoked when the RecyclerView has been scrolled.

Inherited methods

From class java.lang.Object

Public constructors

RecyclerView.OnScrollListener

added in version 22.1.0
RecyclerView.OnScrollListener ()

Public methods

onScrollStateChanged

added in version 22.1.0
void onScrollStateChanged (RecyclerView recyclerView, 
                int newState)

Callback method to be invoked when RecyclerView's scroll state changes.

Parameters
recyclerView RecyclerView: The RecyclerView whose scroll state has changed.

newState int: The updated scroll state. One of SCROLL_STATE_IDLE, SCROLL_STATE_DRAGGING or SCROLL_STATE_SETTLING.

onScrolled

added in version 22.1.0
void onScrolled (RecyclerView recyclerView, 
                int dx, 
                int dy)

Callback method to be invoked when the RecyclerView has been scrolled. This will be called after the scroll has completed.

This callback will also be called if visible item range changes after a layout calculation. In that case, dx and dy will be 0.

Parameters
recyclerView RecyclerView: The RecyclerView which scrolled.

dx int: The amount of horizontal scroll.

dy int: The amount of vertical scroll.

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.
(Sep 2017 survey)