public static abstract class RecyclerView.OnScrollListener
extends Object
java.lang.Object | |
↳ | android.support.v7.widget.RecyclerView.OnScrollListener |
当RecyclerView上发生滚动事件时,可以将OnScrollListener添加到RecyclerView中以接收消息。
Public constructors |
|
---|---|
RecyclerView.OnScrollListener() |
Public methods |
|
---|---|
void |
onScrollStateChanged(RecyclerView recyclerView, int newState) 回调方法在RecyclerView的滚动状态改变时被调用。 |
void |
onScrolled(RecyclerView recyclerView, int dx, int dy) 回滚方法在RecyclerView被滚动时被调用。 |
Inherited methods |
|
---|---|
From class java.lang.Object
|
RecyclerView.OnScrollListener ()
void onScrollStateChanged (RecyclerView recyclerView, int newState)
回调方法在RecyclerView的滚动状态改变时被调用。
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 . |
void onScrolled (RecyclerView recyclerView, int dx, int dy)
回滚方法在RecyclerView被滚动时被调用。 这将在滚动完成后调用。
如果在布局计算后可见项目范围发生更改,则也会调用此回调。 在这种情况下,dx和dy将为0。
Parameters | |
---|---|
recyclerView |
RecyclerView : The RecyclerView which scrolled. |
dx |
int : The amount of horizontal scroll. |
dy |
int : The amount of vertical scroll. |