Kory
Kory

Reputation: 31

How can you programmatically show groups of an AnimatedVectorDrawable?

I am trying to animate groups inside my AnimatedVectorDrawable without them reseting after each is shown. The id provided is my animation for each group, but when called a second time the first group is lost. Any Ideas?

            animationView.setBackgroundResource(id);
            animationDrawable = (AnimatedVectorDrawable) animationView.getBackground();
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                animationDrawable.start();
            }

Upvotes: 2

Views: 374

Answers (0)

Related Questions