Skip to content

Instantly share code, notes, and snippets.

@youxiachai
Last active December 17, 2015 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save youxiachai/5561119 to your computer and use it in GitHub Desktop.
Save youxiachai/5561119 to your computer and use it in GitHub Desktop.
private int mLastFirstVisibleItem;
private boolean mIsScrollingUp;
ew OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
}
@Override
public void onScroll(AbsListView view, int firstVisibleItem,
int visibleItemCount, int totalItemCount) {
if(currentFirstVisibleItem > firstVisibleItem){
//scrolling to top of list
Log.d("xlistview", "scrolling to top of list");
}else if (currentFirstVisibleItem < firstVisibleItem){
//scrolling to bottom of list
Log.d("xlistview", "scrolling to bottom of list");
}
currentFirstVisibleItem = firstVisibleItem;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment