Pawel Jezierski Pawel Jezierski - 1 year ago 60
Android Question

Animating imageview broken if it's started again before one cycle finishes

I've got an ImageView that I rotate with animation by 180 degrees with OnClickListener. If it's triggered very fast (before one animation finishes) the animation bugs out and leaves the View at weird angle (for example rotated 47 degrees versus basic state).

How to prevent next animation before current one finishes or how to deal with it in another way?

bankExpandArrow.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
if (totalText.getVisibility() == View.GONE) {
else {

Answer Source

try using rotation instead of rotationBy