Code example for Scroller

Methods: abortAnimation, computeScrollOffset, getCurrX, getFinalX, startScroll

0
		if (open) {
			setMenuState(MENU_STATE_OPENING);
			mScroller.startScroll(startX, 0, dx, 0, duration);
		} else { 
			setMenuState(MENU_STATE_CLOSING);
			mScroller.startScroll(startX, 0, -startX, 0, duration);
		} 
		postAnimationInvalidate(); 
 
	} 
 
	private void postAnimationInvalidate() { 
		if (mScroller.computeScrollOffset()) {
			final int oldX = mContentLeft;
			final int x = mScroller.getCurrX();
			if (x != oldX)
				setContentLeft(x);
			if (x != mScroller.getFinalX()) {
				postDelayed(mDragRunnable, ANIMATION_DELAY);
				return; 
			} 
		} 
		completeAnimation(); 
	} 
 
	private void completeAnimation() { 
		mScroller.abortAnimation();
		final int finalX = mScroller.getFinalX();
		setContentLeft(finalX);
		setMenuState(mContentLeft == 0 ? MENU_STATE_CLOSED : MENU_STATE_OPEN);
	} 
 
	private void endDrag() {