question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Animation stopped without onAnimationStop getting called

See original GitHub issue

Description

I want to hide simpleDraweeView after gif animation completion. So I have added AnimationListener and hide my controller onAnimationStop. But half of the time it does not call the onAnimationStop method. Let me know if I am doing something wrong.

 new BaseControllerListener() {
        @Override
        public void onFinalImageSet(
          String id,
          @Nullable Object imageInfo,
          @Nullable final Animatable animatable) {
          if (animatable != null) {
            AnimatedDrawable2 animatedDrawable = (AnimatedDrawable2) animatable;
            animatedDrawable.setAnimationListener(new AnimationListener() {
              @Override
              public void onAnimationStart(AnimatedDrawable2 drawable) {

                Log.i(TAG, "onAnimationStart: ");
              }

              @Override
              public void onAnimationStop(AnimatedDrawable2 drawable) {
                .setVisibility(View.GONE);
                Log.i(TAG, "onAnimationStop: ");
              }

              @Override
              public void onAnimationReset(AnimatedDrawable2 drawable) {
                Log.i(TAG, "onAnimationReset: ");
              }

              @Override
              public void onAnimationRepeat(AnimatedDrawable2 drawable) {
                Log.i(TAG, "onAnimationRepeat: ");
              }

              @Override
              public void onAnimationFrame(AnimatedDrawable2 drawable, int frameNumber) {
                Log.i(TAG, "onAnimationFrame: "+frameNumber);
              }
            });
            Log.i(TAG, "animatable.start();: ");
            animatable.start();
          }
        }
      })

Additional Information

  • Fresco version:1.8.1
  • Platform version: Android 7.1.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
defHLTcommented, May 29, 2018

@PalDhv and @test01wrk, thank you for this, but I’m still not able to reproduce it on my side. If you could provide a sample project with this bug, that would be awesome and I would take a look at it.

1reaction
defHLTcommented, May 18, 2018

Can’t reproduce right now. @PalDhv, can you please share your gif? @test01wrk can you please share your code and gif?

Read more comments on GitHub >

github_iconTop Results From Across the Web

onAnimationEnd is not getting called, onAnimationStart works ...
I'm animating ScrollView contents using TranslateAnimation. When animation starts, the onAnimationStart listener is called but the ...
Read more >
AnimationTrack.Looped Does Not Replicate - Engine Features
Stopped:Connect(OnAnimationStop) table.insert(UsedAnimations, ... Calling AnimationTrack:Stop() doesn't stop the animation on the client.
Read more >
react-sequence-animator - npm
This is a supper simple React library that lets us create animations in an easy ... a callback function that is called when...
Read more >
CssTransition.js Source Code | ExtAngular ... - modern
runningNameMap, toPropertyNames, i, ln, name;. animation.un('stop', 'onAnimationStop', this);. if (runningData) {. runningNameMap = runningData.nameMap;. }.
Read more >
Scripting API: Animation.Stop - Unity - Manual
Stops an animation named name . Stopping an animation also Rewinds it to the Start. using UnityEngine; public class ExampleScript : MonoBehaviour ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found