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 s
Unfortunately a gif will not animation inside of an ImageView on its own. You will have to create a new subclass of View to handle this for you.
Show .gif with android.graphics.Movie
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" />