GifImageView displaying animated GIF flickers
josefgrunig opened this issue · 5 comments
When displaying GIF with GifImageView the render flickers and flashes. Saw already similar closed issue suggesting to go for the GifTextureView, but unfortunately there is no frame seek support. And I really would like to stick with the ImageView in order to handle also static images.
Any suggestion on how handle this issue? It happened both a recent samsung and more dated phone.
Isn't it possible to address this issue? Seems to bump up quite often.
If you have some idea how to do that in plain views please raise a PR.
I have no idea, sorry. What I need is to seek frames or at least advancing frame by frame and I see it only in GifImageView. Unfortunately the rendering flickers with GifImageView... what is the issue related to? do you have any idea?
Or you have any suggestion on how add seek to GifTextureView? Would I still be able to draw the view Hierarchy into a bitmap using a GifTextureView?
If it is an issue related to the image size / number of frames per second, is it possible during the loading of the GIF to have a downsampled version, or eventually force to skip frames during the Bitmap update. I suppose the ImageView is updated with a new Bitmap only when there is actually a new GIF frame, correct? Maybe overriding with a custom frame rate value that skips frame if this is updating too fast.
Hi @koral-- I made some progress. It seems that the buffer update of the drawable is done on a background thread and might happen that the main thread draws the View while the bitmap has not been yet completely updated. At least this is what I noticed when performing seek operations and view bitmap captures. When performing the seek with the blocking version the problem has completely gone. Still the problem persists when using the builtin play feature for the ImageView. Is there a way to sync the main thread with the draw update, or having the library not using the background thread / async seek?
Thank you!
Sorry for the delay. Now I get it.
You can pass a custom executor like here: https://github.com/koral--/android-gif-drawable/issues/267#issuecomment-206962158