Start playing GIFs only when the user swipes to them
I mean fullscreen only, ignore thumbnails
For me, gifs are only playing when I open them fullscreen. That's the expected behavior, right?
Or do you mean the state when the user is in fullscreen but is in the scroll state between two images?
yeah, exactly. It is about fullscreen view only. If you open a folder full of GIFs, only the opened visible file should play, the ones at the side pages not. Once you swipe to the side the new GIF should start playing.
I investigated this thing, and it seems that for now, there's no easy way to pause a GIF inside a TextureView.
We can switch to ImageView, but that can bring out some other bugs.
The other option is to set TextureView input source to null when the picture goes out of the screen, and reload it when it is on the screen again so the animation will start again from the beginning. But then we have to also show a static gif image placeholder so that the user sees something while he started swiping to the gif image but did not finish the scroll. But then again – we either have to preload the gif on Fragment creation or it will flicker when user opens it. So from the performance standpoint, it is not a good solution anyway.
lets wait till the library implements it then, I dont want to add any dirty hacks for it