public abstract static class RecyclerView.OnScrollListener extends Object
Constructor and Description |
---|
OnScrollListener() |
Modifier and Type | Method and Description |
---|---|
void |
onScrolled(RecyclerView recyclerView,
int dx,
int dy)
Callback method to be invoked when the RecyclerView has been scrolled.
|
void |
onScrollStateChanged(RecyclerView recyclerView,
int newState)
Callback method to be invoked when RecyclerView's scroll state changes.
|
public void onScrollStateChanged(RecyclerView recyclerView, int newState)
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)
This callback will also be called if visible item range changes after a layout calculation. In that case, dx and dy will be 0.
recyclerView
- The RecyclerView which scrolled.dx
- The amount of horizontal scroll.dy
- The amount of vertical scroll.