Tengo el siguiente codigo que muestra una animacion de Lottie, lo que necesito saber es como detectar que finalizo para poder mostrar un Toast:
public class SplashScreen extends AppCompatActivity {
LottieAnimationView lottieAnimationView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
lottieAnimationView = findViewById(R.id.lottieAnimationView);
startCheckAnimation();
}
private void startCheckAnimation(){
ValueAnimator animator = ValueAnimator.ofFloat(0f, 1f).setDuration(2500);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
@Override
public void onAnimationUpdate(ValueAnimator animation){
lottieAnimationView.setProgress((Float)animation.getAnimatedValue());
}
});
if(lottieAnimationView.getProgress() == 0f){
animator.setStartDelay(500);
animator.start();
}else{
lottieAnimationView.setProgress(0f);
}
}
}