Fling animation is an animation that continues an initial momentum (most often from gesture
velocity) and gradually slows down. The fling animation will come to a stop when the velocity of
the animation is below the threshold derived from setMinimumVisibleChange(float),
or when the value of the animation has gone beyond the min or max value defined via
setMinValue(float) or setMaxValue(float).
It is recommended to restrict the fling animation with min and/or max value, such that the
animation can end when it goes beyond screen bounds, thus preserving CPU cycles and resources.
For example, you can create a fling animation that animates the translationX of a view:
FlingAnimation flingAnim = new FlingAnimation(view, DynamicAnimation.TRANSLATION_X)
// Sets the start velocity to -2000 (pixel/s)
// Optional but recommended to set a reasonable min and max range for the animation.
// In this particular case, we set the min and max to -200 and 2000 respectively.
Start velocity of the animation. Default velocity is 0. Unit: pixel/second
A non-zero start velocity is required for a FlingAnimation. If no start velocity is
set through setStartVelocity(float), the start velocity defaults to 0. In that
case, the fling animation will consider itself done in the next frame.
Note when using a fixed value as the start velocity (as opposed to getting the velocity
through touch events), it is recommended to define such a value in dp/second and convert it
to pixel/second based on the density of the screen to achieve a consistent look across