I'm testing out an animation on an ImageView
.
I want the ImageView
to move down 1500 in 1 second and then up 1500 in the next 1 second (back to where is started).
For some reason the imageView only ever does one translation and not the other. Why is this?
imageView.animate().translationYBy(1500).setDuration(1000);
imageView.animate().translationYBy(-1500).setDuration(1000);
Another example:
imageView.animate().translationYBy(1500).setDuration(1000);
imageView.animate().translationXBy(-1500).setDuration(1000);
This does the X and Y animations at the same time, I thought it would do the Y animation over 1 second and then do the X animation over the next second.
Can someone please explain where I am going wrong?