2.
<groupId>pl.droidsonroids.gif</groupId>
3.
<artifactId>android-gif-drawable</artifactId>
4.
<version>insert latest version here</version>
5.
<type>aar</type>
6.
</dependency>
Requirements
Android 1.6+ (API level 4+)
Building from source
Android NDK needed to compile native sources
Usage
From XML
The simplest way is to use GifImageView (or GifImageButton) like a normalImageView:
1.
<pl.droidsonroids.gif.GifImageView
2.
android:layout_width=``"match_parent"
3.
android:layout_height=``"match_parent"
4.
android:src=``"@drawable/src_anim"
5.
android:background=``"@drawable/bg_anim"
6.
/>
If drawables declared by android:src and/or android:background are GIF files then they will be automatically recognized asGifDrawables and animated. If given drawable is not a GIF then mentioned Views work like plainImageView and ImageButton.
GifTextView allows you to use GIFs as compound drawables and background.
1.
<pl.droidsonroids.gif.GifTextView
2.
android:layout_width=``"match_parent"
3.
android:layout_height=``"match_parent"
4.
android:drawableTop=``"@drawable/left_anim"
5.
android:drawableStart=``"@drawable/left_anim"
6.
android:background=``"@drawable/bg_anim"
7.
/>
From Java code
GifImageView, GifImageButton and GifTextView have also hooks for setters implemented. So animated GIFs can be set by cal