onScrolled
Called when the scroll position of this RecyclerView changes. Subclasses should use this method to respond to scrolling within the adapter's data set instead of an explicit listener.
This method will always be invoked before listeners. If a subclass needs to perform any additional upkeep or bookkeeping after scrolling but before listeners run, this is a good place to do so.
This differs from onScrollChanged in that it receives the distance scrolled in either direction within the adapter's data set instead of absolute scroll coordinates. Since RecyclerView cannot compute the absolute scroll position from any arbitrary point in the data set, onScrollChanged
will always receive the current getScrollX and getScrollY values which do not correspond to the data set scroll position. However, some subclasses may choose to use these fields as special offsets.
Parameters
horizontal distance scrolled in pixels
vertical distance scrolled in pixels