Android creates ViewPropertyAnimator animation chain

I am trying to do this:

public void onClick(View view){ tv.animate().x(600).y(100).scaleX(3).scaleY(3); tv.animate().x(400).y(1400).scaleX(1).scaleY(1); } 

but it skips the first line of the animation. How can I get him to bind them, so first he will do the first line and then the next?

+6
source share
1 answer

You can try this

  Runnable endAction = new Runnable() { public void run() { tv.animate().x(400).y(1400).scaleX(1).scaleY(1); } }; tv.animate().x(600).y(100).scaleX(3).scaleY(3).withEndAction(endAction); 

as indicated in the documentation.

+14
source

Source: https://habr.com/ru/post/950425/


All Articles