Package icyllis.modernui.widget
Interface AbsListView.OnScrollListener
- Enclosing class:
AbsListView
public static interface AbsListView.OnScrollListener
Interface definition for a callback to be invoked when the list or grid
has been scrolled.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The user had previously been scrolling using touch and had performed a fling.static final int
The view is not scrolling.static final int
The user is scrolling using touch, and their finger is still on the screen -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.
-
Field Details
-
SCROLL_STATE_IDLE
static final int SCROLL_STATE_IDLEThe view is not scrolling. Note navigating the list using the trackball counts as being in the idle state since these transitions are not animated.- See Also:
-
SCROLL_STATE_TOUCH_SCROLL
static final int SCROLL_STATE_TOUCH_SCROLLThe user is scrolling using touch, and their finger is still on the screen- See Also:
-
SCROLL_STATE_FLING
static final int SCROLL_STATE_FLINGThe user had previously been scrolling using touch and had performed a fling. The animation is now coasting to a stop- See Also:
-
-
Method Details
-
onScrollStateChanged
Callback method to be invoked while the list view or grid view is being scrolled. If the view is being scrolled, this method will be called before the next frame of the scroll is rendered. In particular, it will be called before any calls toAdapter.getView(int, View, ViewGroup)
.- Parameters:
view
- The view whose scroll state is being reportedscrollState
- The current scroll state. One ofSCROLL_STATE_TOUCH_SCROLL
orSCROLL_STATE_IDLE
.
-
onScroll
Callback method to be invoked when the list or grid has been scrolled. This will be called after the scroll has completed- Parameters:
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 adapter
-