koral--/android-gif-drawable

Remove animation on `GifTextureView`

archie94 opened this issue · 2 comments

The documentation says

Sets the source of the animation. Pass {@code null} to remove current source.
Equivalent of {@code setInputSource(inputSource, null)}.

However the Texture view seems to persist the last frame of the animation. Is this the intended behavior?

On a GifImageView doing

gifImageView.setImageDrawable(null)

removes the animation completely. It would be nice if we can have consistent behavior across the two Gif views.
Excited to know your thoughts on the same.

Reproducible commit

Thanks!

Good catch.
AFAIR at the time of writing neither behavior was explicitly intended. The purpose of removing the input source was to free the related resources.
I think that it is a good idea to clear the texture.
Wanna make a PR?

Yes. Will send out a fix.