Code example for Scroller

Methods: fling

0
     * computeScroll method 
     * @param velocityX 
     */ 
    private void fling(int velocityX) {
        if (getChildCount() > 0) {
            mScroller.fling(mScrollX, 0, velocityX, 0, Integer.MIN_VALUE, Integer.MAX_VALUE, 0, 0);
            invalidate();
        } 
    } 
 
    public void setOnScrollListener(OnScrollListener l) {
        listener = l;
    } 
 
    public interface OnScrollListener { 
        public void onScroll(long x);
    } 
}