public abstract class

RecyclerView.OnScrollListener

extends java.lang.Object

 java.lang.Object

↳androidx.recyclerview.widget.RecyclerView.OnScrollListener

Overview

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

Summary

Constructors
publicOnScrollListener()

Methods
public voidonScrolled(RecyclerView recyclerView, int dx, int dy)

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

public voidonScrollStateChanged(RecyclerView recyclerView, int newState)

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

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public OnScrollListener()

Methods

public void onScrollStateChanged(RecyclerView recyclerView, int newState)

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

Parameters:

recyclerView: The RecyclerView whose scroll state has changed.
newState: The updated scroll state. One of RecyclerView.SCROLL_STATE_IDLE, RecyclerView.SCROLL_STATE_DRAGGING or RecyclerView.SCROLL_STATE_SETTLING.

public 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: The RecyclerView which scrolled.
dx: The amount of horizontal scroll.
dy: The amount of vertical scroll.