The startup page of one of the company's apps wants to be animated GIF, not previously added to the GIF in Android, so hurry hungry!
Objective
We all know ImageView is not the perfect loading GIF format picture, if we in ImageView src specified resources are GIF format, we will be pleasantly surprised to find that the picture will stay in the first frame, that is, there will be no animation effect. Of course, after a few modifications, we can make GIF perfectly loaded on the ImageView.
Body
Android provides us with a movie class that allows us to implement the target of loading GIF format resources. We need to import Android.graphics.Movie This package, of course this is also Android comes with. So our main approach is to inherit a ImageView subclass and load the GIF resource by overwriting the OnDraw method.
Detailed reference
Android App series: perfect for running GIF format ImageView (attached source)
Android Open Source project: gifview--android Display gif animations
Android use GIF to make Start page