Code example for Scroller

Methods: abortAnimation, computeScrollOffset, getCurrX, getFinalX

0
            postAnimationInvalidate(); 
        } 
    }; 
     
    private void postAnimationInvalidate() { 
        if (mScroller.computeScrollOffset()) {
            final int oldX = mCurrentOffset;
            final int x = mScroller.getCurrX();
            if (x != oldX){
            	setOffsetPixels(x);
            } 
            if (x != mScroller.getFinalX()) {
                postOnAnimation(mDragRunnable);
                return; 
            } 
        } 
 
        // move contentscomplete scroll Animation 
        mScroller.abortAnimation();
        final int finalX = mScroller.getFinalX();
        setOffsetPixels(finalX);
        setCoverState(finalX == 0 ? STATE_CLOSED : STATE_OPEN);
         
    } 
}