Created
June 20, 2018 20:07
-
-
Save lduboeuf/b9e3d9995ac99f950492a463133a2f39 to your computer and use it in GitHub Desktop.
android animation infinite loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
source : https://medium.com/google-developers/re-animation-7869722af206