I want to animate an image diagonally like below picture. I have tried translate animation but I am only able to do it either parallel X-axis or parallel Y-axis.
But couldn't able to figure out how to do it diagonally. And I am also not sure it can be done by translate animation or some other kinda animation. So please suggest me how can I do it or if any one can give me a helpful link then also I will be obiliged.
You can achieve this with just one ObjectAnimator.
And in the same class add the callback function.
And here is the customtype evaluator that combines X and Y.
Enjoy !
One way is to use an
AnimatorSet
to play moreObjectAnimator
together.Or you could use a custom
View
with a customProperty
, but in this case you will need to compute translation on X and Y yourself:And use it to animate: