Code example for Scroller

Methods: computeScrollOffset, getCurrX, getCurrY, isFinished

0
	public View getDisplayedView() {
		return mChildViews.get(mCurrent);
	} 
 
	public void run() { 
		if (!mScroller.isFinished()) {
			mScroller.computeScrollOffset();
			int x = mScroller.getCurrX();
			int y = mScroller.getCurrY();
			mXScroll += x - mScrollerLastX;
			mYScroll += y - mScrollerLastY;
			mScrollerLastX = x;
			mScrollerLastY = y;
			requestLayout();
			post(this);
		} 
		else if (!mUserInteracting) {
			// End of an inertial scroll and the user is not interacting. 
			// The layout is stable 
			View v = mChildViews.get(mCurrent);
			postSettle(v);