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:
[tmh_article_ads]
Usage
Download
Gradle
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'
Add 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" />
Last 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