"Third-party open source framework Android Glide loading GIF resource images to Android ImageView"
Normally Android ImageView can't load GIF images, and if you don't do any processing, the GIF loaded into ImageView shows only the first frame. There are many solutions available on the web, and there are many open source frameworks that customize the GIF view to load GIFs, mostly with the help of Android movie, the GIF image resource as a stream, parsing into Android movie display, The basic idea of these customizations is to first detect if the image resource is a GIF, and if so, parse it according to Android movie.
There is an Android glide open source framework that itself does a good job of loading and caching pictures, and I have previously written an article specifically on how to use the Android Glide library in your own project specifically (the link address of the article: http://blog.csdn.net/ zhangphil/article/details/45535693), at the same time, Android glide loading GIF pictures is also very convenient, the need to load the GIF map into the drawable directory, and then the normal andriod ImageView setting a picture resource r.drawanle.xxx exactly the same, very simple. or from the Web URL to load a picture, the developer does not care whether the picture resource is GIF or other JPG or PNG format, directly as a normal picture loading can, as to the image of the resource format of the judgment processing and drawing, there are Android glide all do.
Now for example:
Package Zhangphil.gif;import Com.bumptech.glide.glide;import Android.support.v7.app.actionbaractivity;import Android.widget.imageview;import Android.os.bundle;public class Mainactivity extends Actionbaractivity {@ overrideprotected void OnCreate (Bundle savedinstancestate) {super.oncreate (savedinstancestate); Setcontentview ( R.layout.activity_main); ImageView ImageView = (ImageView) Findviewbyid (R.id.imageview); Glide.with (this). Load (r.drawable.loading). to (ImageView);}}
Where r.drawable.loading is the Loading.gif diagram loaded in the drawable directory:
Load GIF Resource Graph into Android ImageView based on open source framework Glide