Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show Animated GIF image in android application?

I want to show an animated GIF image in an android application like the image below. I have tried the webview but no success. How to show the animated gif in the application?enter image description here

like image 407
aman.nepid Avatar asked Oct 04 '12 12:10

aman.nepid


People also ask

Can you send GIFs to Android?

Sending GIFs Saved on Your AndroidTap the plus sign (+) in the lower-left corner. Scroll through your images to find the GIF you want to send. On Android 11, scroll down to select Attach file, and choose Photos to browse through images stored in Google Photos. Add a message if desired, and tap Send.

How do I add a GIF image to my Android app?

Step 1: Install “Refractored.GifImageView” Nuget package into your Xamarin based Android project. Step 2: Add the following code into your Main Android Layout file (XML) or in the layout where you want to display GIF image. Step 3: Add GIF file to your Drawable folder ( here loading.gif) Step 4: Update your Activity class.

How to display animated GIF images in Android using Kotlin?

This example demonstrates how to display animated GIF images in Android using Kotlin. Step 1 − Create a new project in Android Studio, go to File? New Project and fill all required details to create a new project. Step 2 − Add the following dependency in build.gradle (module:app) Step 3 − Add the following code to res/layout/activity_main.xml.

How to display GIF image in Android layout using Xamarin?

Step 1: Install “Refractored.GifImageView” Nuget package into your Xamarin based Android project. Step 2: Add the following code into your Main Android Layout file (XML) or in the layout where you want to display GIF image.

How to show animated GIF in an application?

There are no proper solutions for showing the animated gif in application. You can view This solution to make the animated gif play in a layout. I tried so many library to use Animated gif . But every library is lagging and crushing .


1 Answers

You can also use this lib to easily support a gifDrawable.

Just use GifImageView instead of normal ImageView:

<pl.droidsonroids.gif.GifImageView     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:src="@drawable/your_anim"/> 

and locate your gif-file under the src attr. That's all!

like image 75
RyuZz Avatar answered Sep 21 '22 19:09

RyuZz