public static interface AbsListView.OnScrollListener
Modifier and Type | Field and Description |
---|---|
static int |
SCROLL_STATE_FLING
The user had previously been scrolling using touch and had performed a fling.
|
static int |
SCROLL_STATE_IDLE
The view is not scrolling.
|
static int |
SCROLL_STATE_TOUCH_SCROLL
The user is scrolling using touch, and their finger is still on the screen
|
Modifier and Type | Method and Description |
---|---|
void |
onScroll(AbsListView view,
int firstVisibleItem,
int visibleItemCount,
int totalItemCount)
Callback method to be invoked when the list or grid has been scrolled.
|
void |
onScrollStateChanged(AbsListView view,
int scrollState)
Callback method to be invoked while the list view or grid view is being scrolled.
|
static final int SCROLL_STATE_IDLE
static final int SCROLL_STATE_TOUCH_SCROLL
static final int SCROLL_STATE_FLING
void onScrollStateChanged(AbsListView view, int scrollState)
Adapter.getView(int, View, ViewGroup)
.view
- The view whose scroll state is being reportedscrollState
- The current scroll state. One of SCROLL_STATE_IDLE
,
SCROLL_STATE_TOUCH_SCROLL
or SCROLL_STATE_IDLE
.void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount)
view
- The view whose scroll state is being reportedfirstVisibleItem
- the index of the first visible cell (ignore if
visibleItemCount == 0)visibleItemCount
- the number of visible cellstotalItemCount
- the number of items in the list adaptor