createVerticalAnimation

fun createVerticalAnimation(fromY: Float, toY: Float, duration: Long, accelerate: Boolean): Animation

Return

an Animation object with appropriate vertical transformation and duration

Parameters

fromY

Change in Y coordinate to apply at the start of the animation, represented as a percentage (where 1.0 is 100%).

toY

Change in Y coordinate to apply at the end of the animation, represented as a percentage (where 1.0 is 100%).

duration

Amount of time (in milliseconds) for the animation to run.

accelerate

Whether to use the accelerate interpolator or the decelerate interpolator.