My layout have lots of imageviews. I want to show .gif animated file in just one imageview. I tried Yash method (Adding gif image in an ImageView in android) but .gif file shown all layout. Other views dissappeared.
I want to show all.
Any idea?
Here we are loading the gif using ImageView and Glide Library. Insert the following dependency to build. gradle file of your project. Navigate to the app > res > layout > activity_main.
Android: Sure, add your individual splash screen graphics. Just replace the included splash. gif files with your own image file. Make sure to use GIF format (animated or static).
This example demonstrates how do I display animated gif images in android. 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 code to res/layout/activity_main. xml.
If you don't want to use Glide, just add this to your dependencies and create your unique 'gif'. Check for the latest version before use. ImageView:
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19'
Works very efficiently with minimal lines of code. An example is:
<pl.droidsonroids.gif.GifImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/dancer"
android:src="@drawable/maddancer" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With