How can I play two animatedVectorDrawables sequentially?

37 Views Asked by At

I saw this tutorials (1 and 2) about using AnimatedVectorDrawableCompat.

What's the way to play two animatedVectorDrawables sequentially?

For ObjectAnimator I would use AnimatorSet. For AnimatedVectorDrawableCompat I should use AnimationCallback ?

    if (drawable instanceof AnimatedVectorDrawableCompat) {
      AnimatedVectorDrawableCompat avdc = (AnimatedVectorDrawableCompat) drawable;
      avdc.registerAnimationCallback(new Animatable2Compat.AnimationCallback(){
        public void onAnimationEnd(Drawable drawable) {

        };        
      });
      avdc.start();
}

I saw it's problematic for API and I thought to ask if there is a cleaner way.

enter image description here

0

There are 0 best solutions below