createHorizontalAnimation

fun createHorizontalAnimation(fromX: Float, toX: Float, duration: Long, accelerate: Boolean): Animation

Return

an Animation object with appropriate horizontal transformation and duration

Parameters

fromX

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

toX

Change in X 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.