Code example for Scroller

Methods: startScroll

0
	public void scrollToScreen(int whichScreen) {		
		// get the valid layout page 
		whichScreen = Math.max(0, Math.min(whichScreen, getChildCount() - 1));
		if (getScrollX() != (whichScreen * getWidth())) {
			final int delta = whichScreen * getWidth() - getScrollX();
			mScroller.startScroll(getScrollX(), 0, delta, 0,
					Math.abs(delta) * 1);//持续滚动时间 以毫秒为单位
			mCurScreen = whichScreen;
			invalidate(); // Redraw the layout
             
			if (mOnViewChangeListener != null)
            { 
            	mOnViewChangeListener.OnViewChange(mCurScreen);
            } 
		} 
	} 
	 
	public void setToScreen(int whichScreen) {
		whichScreen = Math.max(0, Math.min(whichScreen, getChildCount() - 1));
		mCurScreen = whichScreen;
Connect your IDE to all the code out there  Get Codota for Java