Code example for Scroller

Methods: computeScrollOffset, getCurrX, getCurrY, isFinished

0
		postInvalidate();
	} 
 
	@Override 
	public void computeScroll() { 
		if (!mScroller.isFinished()) {
			if (mScroller.computeScrollOffset()) {
				int oldX = getScrollX();
				int oldY = getScrollY();
				int x = mScroller.getCurrX();
				int y = mScroller.getCurrY();
				if (oldX != x || oldY != y) {
					scrollTo(x, y);
				} 
				// Keep on drawing until the animation has finished. 
				invalidate();
				return; 
			} 
		} 
	}