Something like this should work. You just need to cache the old position and offset and use it to check the direction. You can also filter on scrollState:
listView.setOnScrollListener(new OnScrollListener() { @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { } @Override public void onScrollStateChanged(AbsListView view, int scrollState) { int position = listView.getFirstVisiblePosition(); View v = listView.getChildAt(0); int offset = (v == null) ? 0 : v.getTop(); if (mPosition < position || (mPosition == position && mOffset < offset) {
source share