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 theonAnimationEnd
callback first and then invokesstop()
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.) callsstart()
from within theonAnimationEnd()
callback. This doesn't work becausestop()
is called right after the onAnimationEnd() callback is complete.Reversing the order of these two calls to enable this use-case.