Simple-Gallery icon indicating copy to clipboard operation
Simple-Gallery copied to clipboard

Start playing GIFs only when the user swipes to them

Open tibbi opened this issue 4 years ago • 6 comments

tibbi avatar Aug 18 '21 22:08 tibbi

I mean fullscreen only, ignore thumbnails

tibbi avatar Aug 19 '21 07:08 tibbi

For me, gifs are only playing when I open them fullscreen. That's the expected behavior, right?

qwertyfinger avatar Aug 29 '21 14:08 qwertyfinger

Or do you mean the state when the user is in fullscreen but is in the scroll state between two images?

qwertyfinger avatar Aug 29 '21 14:08 qwertyfinger

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.

tibbi avatar Aug 29 '21 14:08 tibbi

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.

qwertyfinger avatar Sep 03 '21 14:09 qwertyfinger

lets wait till the library implements it then, I dont want to add any dirty hacks for it

tibbi avatar Sep 05 '21 18:09 tibbi