Code example for Scroller

Methods: startScroll

0
		int duration = computeDuration(velocity, dx);
		System.out.println("Duration is --->>>"+duration);
		if(duration < 250){
			duration = MAX_SETTLE_DURATION; 
		} 
		scroller.startScroll(sx, sy, dx, 0, 500);
		invalidate();
	}	 
	 
	private int computeDuration(float velocity, int distance){
		velocity = Math.abs(velocity);
		return 4 * Math.round(100 * Math.abs(distance / velocity));
	} 
 
}