Code example for Scroller

Methods: fling

0
         
        public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { 
            lastScrollY = 0; 
            final int maxY = 0x7FFFFFFF; 
            final int minY = -maxY; 
            scroller.fling(0, lastScrollY, 0, (int) -velocityY, 0, 0, minY, maxY); 
            setNextMessage(MESSAGE_SCROLL); 
            return true; 
        } 
    }; 
 
    // Messages 
    private final int MESSAGE_SCROLL = 0;
    private final int MESSAGE_JUSTIFY = 1;
     
    /** 
     * Set next message to queue. Clears queue before. 
     *  
     * @param message the message to set 
     */ 
    private void setNextMessage(int message) {