Android loading GIF map best practices

cause

Recently encountered in the project, it is necessary to display a local GIF diagram on the interface. As usual, I directly implemented it with glide framework.

Glide address: https://github.com/bumptech/glide

The glide version I use is 4.0.0-rc1. The specific implementation code is as follows:

The effect of running is very Caton, I wonder if it is not right, the mode of compression is adjusted, or is Caton? Cache mode, or Caton. After looking at my GIF picture, the size is still 800K. Is it too big? I changed a 100k GIF picture. This time the display effect is very good and the GIF picture plays smoothly. So far, it is concluded that due to the glide framework itself, the effect of playing large-size GIF images is not very ideal.

programme

Glide can't, so you have to think of other solutions. Go to GitHub.

The first ranked Android GIF drawable library start has 4.8k. This should be good. Try it.

android-gif-drawable : https://github.com/koral--/android-gif-drawable

quote:

Directly replace the ImageView in the layout file with gifimageview

Run up and see. It's really good. The playback is very smooth. This scheme is adopted decisively.

Explore other attributes:

Get the gifdrawable object through the gifimageview object.

summary

The above is the best practice of loading GIF map on Android introduced by Xiaobian. I hope it will help you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>