Skip to content

Instantly share code, notes, and snippets.

@braulio94
Last active February 10, 2018 22:07
Show Gist options
  • Save braulio94/5a5a6cd82173579e3261d7ff676fab7f to your computer and use it in GitHub Desktop.
Save braulio94/5a5a6cd82173579e3261d7ff676fab7f to your computer and use it in GitHub Desktop.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (drawable instanceof Animatable2) {
avd = (AnimatedVectorDrawable) drawable;
avd.registerAnimationCallback(new Animatable2.AnimationCallback() {
@Override
public void onAnimationStart(Drawable drawable) {
super.onAnimationStart(drawable);
//Animation started
}
@Override
public void onAnimationEnd(Drawable drawable) {
super.onAnimationEnd(drawable);
//Animation ended
startActivity(new Intent(SplashActivity.this, MainActivity.class));
finish();
}
});
avd.start();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment