Skip to content

Instantly share code, notes, and snippets.

@qluan
qluan / ListViewScrollTracker.java
Last active September 8, 2015 05:56 — forked from cnnrhill/ListViewScrollTracker.java
Helper class for calculating relative scroll offsets in a ListView or GridView by tracking the position of child views.
import android.util.SparseArray;
import android.widget.AbsListView;
/**
* Helper class for calculating relative scroll offsets in a ListView or GridView by tracking the
* position of child views.
*/
public class ListViewScrollTracker {
private AbsListView mListView;
private SparseArray<Integer> mPositions;