Package 

Class RecyclerView.OnScrollListener


  • 
    public abstract class RecyclerView.OnScrollListener
    
                        

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

    • Method Summary

      Modifier and Type Method Description
      void onScrollStateChanged(@NonNull() RecyclerView recyclerView, int newState) Callback method to be invoked when RecyclerView's scroll state changes.
      void onScrolled(@NonNull() RecyclerView recyclerView, int dx, int dy) Callback method to be invoked when the RecyclerView has been scrolled.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • onScrollStateChanged

         void onScrollStateChanged(@NonNull() 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.
      • onScrolled

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

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

        This callback will also be called if visible item range changes after a layoutcalculation. 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.