Code example for Scroller

0
         * Tracks the decay of a fling scroll 
         */ 
        private Scroller mScroller;
 
        public FlingRunnable() { 
            mScroller = new Scroller(getContext());
        } 
 
        private void startCommon() { 
            // Remove any pending flings 
            removeCallbacks(this);
        } 
         
        public void startUsingVelocity(int initialVelocity) {
            if (initialVelocity == 0) {
                return; 
            } 
             
            startCommon(); 
             
            int initialX = initialVelocity < 0 ? Integer.MAX_VALUE : 0;