Skip to content

Instantly share code, notes, and snippets.

@patrickcousins
patrickcousins / VerticalSmoothScrollView.java
Last active September 21, 2016 12:20
VerticalSmoothScrollView from http://stackoverflow.com/questions/5193678/android-horizontalscrollview-smoothscroll-animation-time/13639106 Added vertical computation. NOTE: to use with API 8 or lower you need to find a compat Scroller, ViewPagerIndicator is a good source to look for a compat Scroller.
public class VerticalSmoothScrollView extends ScrollView
{
private OverScroller myScroller; //TODO implement our own scroller, Scroller and OverScroller can usually be swapped
public VerticalSmoothScrollView( Context context, AttributeSet attrs, int defStyle )
{
super( context, attrs, defStyle );
init();
}