I have placed the following code in a for loop:
set8.playTogether(
ObjectAnimator.ofFloat(ball4, "translationX", x1, xn),
ObjectAnimator.ofFloat(ball4, "translationY", y1, yn),
ObjectAnimator.ofFloat(ball8, "translationX", xn, x1),
ObjectAnimator.ofFloat(ball8, "translationY", yn, y1)
);
set8.setDuration(t).start();
Before every iteration of the for loop, I want to wait for the animation of previous iteration to complete. Is there any way to do that?
In my project, I have an onclick listener on an image. I also want that onclicklistener to be nonfunctional until the animation is completed in the above code.
Is there any method to do these things?