create Horizontal Animation
fun createHorizontalAnimation(fromX: Float, toX: Float, duration: Long, accelerate: Boolean): Animation
Return
an Animation object with appropriate horizontal transformation and duration
Parameters
from X
Change in X coordinate to apply at the start of the animation, represented as a percentage (where 1.0 is 100%).
to X
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.