I\'d like to translate an image from left to right on emulator using android animation. I\'m new to android animation. How could I do that?
Thanks.
I am a bit late to the party but worth answering here,
case 1:
if your view is at the left side of the screen and you want to move from left edge to right edge then use this:
imageView.animate()
.translationX(((rootLayout.width - (imageView.width))).toFloat())
.setInterpolator(AccelerateInterpolator()).duration = 1500
case 2: If your view is at the center of the screen and you want to move from center to right edge then use this:
imageView.animate()
.translationX(((rootLayout.width - (imageView.width)) / 2).toFloat())
.setInterpolator(AccelerateInterpolator()).duration = 1500
NOTE:
rootLayout is root view of your XML