I recently found that the v4 library has a utility class AutoScrollHelper, and its subclass is ListViewAutoScrollHelper. Does anyone have a demo for this?
AutoScrollHelper is a View.OnTouchListener.
A simple implementation using ListViewAutoScrollHelper would look something like this:
final ListView list = (ListView) findViewById(android.R.id.list);
final ListViewAutoScrollHelper scrollHelper = new ListViewAutoScrollHelper(list);
scrollHelper.setEnabled(true);
list.setOnTouchListener(scrollHelper);
To begin scrolling, touch your finger near the top (to scroll up) or bottom (to scroll down) edge of the screen and keep it pressed for the amount of time you'd like to remain scrolling.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With