Code example for Scroller

Methods: computeScrollOffset, getCurrX

0
    /** 
     * scroll the element when the mScroller is still scrolling 
     */ 
    @Override 
    public void computeScroll() { 
        if (mScroller.computeScrollOffset()) {
            mScrollX = mScroller.getCurrX();
            reScrollTo(mScrollX,0, true);
            // Keep on drawing until the animation has finished. 
            postInvalidate();
        } 
    } 
 
    @Override 
    public void scrollTo(int x, int y) {
        if (!mScroller.isFinished()) {
            mScroller.abortAnimation();
        } 
        reScrollTo(x, y, true);
    }