Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GifDrawable: Call stop before notifying end to listeners #5451

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

vigneshvg
Copy link
Contributor

In the current code, GifDrawable calls the onAnimationEnd callback first and then invokes stop() to end the animation.

This behavior prevents the following use-case: An app wants to schedule another loop of the GifDrawable when the current loop ends (i.e.) calls start() from within the
onAnimationEnd() callback. This doesn't work because stop() is called right after the onAnimationEnd() callback is complete.

Reversing the order of these two calls to enable this use-case.

In the current code, `GifDrawable` calls the `onAnimationEnd`
callback first and then invokes `stop()` to end the animation.

This behavior prevents the following use-case: An app wants to
schedule another loop of the `GifDrawable` when the current
loop ends (i.e.) calls `start()` from within the
`onAnimationEnd()` callback. This doesn't work because
`stop()` is called right after the onAnimationEnd() callback
is complete.

Reversing the order of these two calls to enable this use-case.
@kanelbulle kanelbulle enabled auto-merge (rebase) September 24, 2024 16:47
@kanelbulle kanelbulle merged commit a98b301 into bumptech:master Sep 24, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants