AnimationDrawable stops in the middle

Asked 2 years ago, Updated 2 years ago, 22 views

final AnimationDrawable ani = (AnimationDrawable) view.getBackground();
            ani.setCallback(new AnimationDrawableCallback(ani, view) {
                @Override
                public void onAnimationAdvanced(int currentFrame, int totalFrames) {
                }

                @Override
                public void onAnimationCompleted() {
                    view.clearAnimation();
                }
            });

Hello, I'm doing the frame animation like above Press the button to run the animation.

If you run consecutive button release animations, it stops in the middle. In my short opinion, I am wondering if the animation will stop when the ui is updatedten thousand We are not running anything other than animation. [Even if you hit the buttons repeatedly, it is controlled not to run again until the execution is finished. ]

Instead of going all the way, the animation runs for about 1, 2, 3 frames and stops. Please give me some advice.

android

2022-09-21 15:28

1 Answers

I can't do it no matter how hard I try, so if the image is big and heavy, it must be too much. So I just changed the bitmap to turning it back in time.;;


2022-09-21 15:28

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.