Use GIF in Android

0
386
Use GIF in Android
Use GIF in Android

Today i am going to show you how to use GIF in Android application after my recent post on use of Springy Facebook Rebound library. Everyone know about GIF(Graphics Interchange Format) which is a great way represent your thought in single image.

I see this post on my Facebook group a member Moe Ma Ka .

In previous article i showed you Top 35 Android Loading Animation which you can implement any of them in your application using GIFView library.

It is a library for playing gifs on Android. Simple android view to display gifs efficiently. You can start, pause and stop gifView. Example usages can be found in example project.

You can see demo above that how to use GIF in Android

Let come with implementation part:

Usage

1Download

Share to get Download linkimage/svg+xml
Unlock this exclusive content by using one of the sharing buttons below.

2Gradle

Add these lines on top-level build file

repositories {
    maven {
        url "https://jitpack.io"
    }
}

On app’s build.gradle

compile 'com.github.Cutta:GifView:1.1'

3Add in view

<com.cunoraz.gifview.library.GifView
            android:id="@+id/gif1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:visibility="gone"
            custom:gif="@mipmap/gif1" />

4Last give some functionalities

GifView gifView1 = (GifView) view.findViewById(R.id.gif1);
                 gifView1.setVisibility(View.VISIBLE);
                   gifView1.play();
                   gifView1.pause();
                   gifView1.setGifResource(R.mipmap.gif5);
                   gifView1.getGifResource();
                   gifView1.setMovieTime(time);
                   gifView1.getMovie();

That’s it. Yes it is simple to implement as you can see. Try to use this library and share with us.

Thanks for being a part of TellMeHow. Please appreciate with your suggestion or comment.

 

Share your thoughts

Loading Facebook Comments ...
Loading Disqus Comments ...