Code example for Scroller

Methods: getCurrX, getCurrY, startScroll

0
     * 
     * @param indexInBuffer Index of the view in the view buffer. 
     */ 
    private void setVisibleView(int indexInBuffer, boolean uiThread) {
        mCurrentScreen = Math.max(0, Math.min(indexInBuffer, getChildCount() - 1));
        int dx = (mCurrentScreen * getWidth()) - mScroller.getCurrX();
        mScroller.startScroll(mScroller.getCurrX(), mScroller.getCurrY(), dx, 0, 0);
        if (dx == 0) {
            onScrollChanged(mScroller.getCurrX() + dx, mScroller.getCurrY(), mScroller.getCurrX() + dx, mScroller.getCurrY());
        } 
        if (uiThread) {
            invalidate();
        } else { 
            postInvalidate();
        } 
    } 
 
    /** 
     * Set the listener that will receive notifications every time the {code 
     * ViewFlow} scrolls. 
     *