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.

Provide callback when animated GIF is done playing

See original GitHub issue

Provide a mechanism for the caller to be notified when an animated GIF has completed all loops. ( Similar to Glide V4’s onAnimationEnd listener - see https://github.com/bumptech/glide/pull/3438 )

For example,

binding.myImageView.load(R.drawable.some_gif_animation) {
   repeatCount(0)
   onAnimationComplete = { /* do something */ }
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
colinrtwhitecommented, Dec 10, 2020

👍 Makes sense. In the meantime as a work-around, MovieDrawable and AnimatedImageDrawable both implement Animatable2/Animatable2Compat which allows you to set a listener for start/end events.

0reactions
rundavidruncommented, Feb 23, 2021

@sagar-viradiya - using binding.fullScreenImage.setImageDrawable(result) still just shows the first frame of the animation. I’m looking forward to getting the update once your PR is integrated. Thanks for writing it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript trigger when gif animation is done - Stack Overflow
I would like a javascript script that detects when the gif is done animating, and then redirects to another site. Is this possible?...
Read more >
React Native's Animated.loop: Invoking A Callback Whenever ...
loop function is great to continuously run animations, but it lacks one feature: invoking a callback whenever an iteration is finished. pexels.
Read more >
withAnimation completion callback with animatable modifiers
A custom AnimatableModifier implementation allows us to get a callback once an animation of a specific property completes. This is in most cases ......
Read more >
Animation: finish event - Web APIs | MDN
The finish event of the Animation interface is fired when the animation finishes playing, either when the animation completes naturally, ...
Read more >
AnimatedImageDrawable - Android Developers
Pass this to setRepeatCount(int) to repeat infinitely. ... A repeat count of 0 means that the animation will play once, regardless of the...
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