Skip to content

KleinerHacker/android-gif

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android GIF Library

The Android GIF Libraray (android-gif) adds support for GIF files in Android like existing structure of Android Bitmap. This is the simplest way to use GIFs in Android:

Examples

The following examples shows you how easy to use is this library:

Load a GIF file

final Gif myGif = GifFactory.decodeByteArray(gifBytes, 0, gifBytes.length);

Show a GIF file on drawable

final Gif myGif = GifFactory.decodeResource(context.getResources(), R.raw.my_gif);
final Drawable myDrawable = new GifDrawable(context.getResources(), myGif);

Scale a loaded GIF

final Gif myGif = GifFactory.decodeStream(gifInputStream);
final Gif myScaledGif = Gif.createScaledGif(myGif, 200, 150, true);

Show single image of GIF

final Gif myGif = GifFactory.decodeFile("test.gif");
final Drawable myDrawable = new BitmapDrawable(context.getResources(), myGif.getFrames()[0].getImage());

Maven Usage

To use the android-gif-library in your application add this to your pom.xml in dependencies part:

<dependency>
  <groupId>com.github.kleinerhacker</groupId>
  <artifactId>android-gif-library</artifactId>
  <version>1.0.0</version>
</dependency>

Alternative you can download the artifact and put it manuelly to your project.


Known Bugs

  • Loop Count faulty: Only one loop or endless loop supported

About

GIF-Reader for android with included GifDrawable

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages