Last active
February 10, 2018 22:07
-
-
Save braulio94/5a5a6cd82173579e3261d7ff676fab7f to your computer and use it in GitHub Desktop.
This file contains 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
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