Android
android.widget
public static interface

android.widget.AbsListView.OnScrollListener

android.widget.AbsListView.OnScrollListener

Interface definition for a callback to be invoked when the list or grid has been scrolled.

Summary

Constants

      Value  
int  SCROLL_STATE_FLING  The user had previously been scrolling using touch and had performed a fling.  0x00000002 
int  SCROLL_STATE_IDLE  The view is not scrolling.  0x00000000 
int  SCROLL_STATE_TOUCH_SCROLL  The user is scrolling using touch, and their finger is still on the screen   0x00000001 

Public Methods

          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.

Details

Constants

public static final int SCROLL_STATE_FLING

The user had previously been scrolling using touch and had performed a fling. The animation is now coasting to a stop
Constant Value: 2 (0x00000002)

public static final int SCROLL_STATE_IDLE

The view is not scrolling. Note navigating the list using the trackball counts as being in the idle state since these transitions are not animated.
Constant Value: 0 (0x00000000)

public static final int SCROLL_STATE_TOUCH_SCROLL

The user is scrolling using touch, and their finger is still on the screen
Constant Value: 1 (0x00000001)

Public Methods

public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount)

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 reported
firstVisibleItem the index of the first visible cell (ignore if visibleItemCount == 0)
visibleItemCount the number of visible cells
totalItemCount the number of items in the list adaptor

public void onScrollStateChanged(AbsListView view, int scrollState)

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 to getView(int, View, ViewGroup).

Parameters

view The view whose scroll state is being reported
scrollState The current scroll state. One of SCROLL_STATE_IDLE, SCROLL_STATE_TOUCH_SCROLL or SCROLL_STATE_IDLE.
Copyright 2007 Google Inc. Build 119366-119366 - 19 Nov 2008 16:04