Skip to content

Instantly share code, notes, and snippets.

@lduboeuf
Created June 20, 2018 20:07
Show Gist options
  • Save lduboeuf/b9e3d9995ac99f950492a463133a2f39 to your computer and use it in GitHub Desktop.
Save lduboeuf/b9e3d9995ac99f950492a463133a2f39 to your computer and use it in GitHub Desktop.
android animation infinite loop
final ImageView animationView = (ImageView) findViewById(R.id.animationView);
final AnimatedVectorDrawableCompat avd = (AnimatedVectorDrawableCompat) animationView.getDrawable();
avd.registerAnimationCallback(new Animatable2Compat.AnimationCallback() {
@Override
public void onAnimationEnd(Drawable drawable) {
animationView.post(new Runnable() {
@Override
public void run() {
avd.start();
}
});
}
});
avd.start();
@lduboeuf
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment