1

How can I display animated GIFs with this library ? The code below only shows a static version of the GIF not a moving one.

    addSlide(new SimpleSlide.Builder()
            .title("This is supposed to be an animated GIF")
            .image(R.drawable.animated_gif)
            .build());

I have taken a look at Glide but I'm not sure how to use it in this case.

Bandy
  • 161
  • 12
  • you. one option is to fork the library and then customize the image view in the library to load the gif using. glide, directly it won't work. you can add this lib as module in our project and customise it – vikas kumar Aug 06 '20 at 10:10

4 Answers4

4

You may use glide to load your gif, so in your gradle have this inside your dependancies

  implementation 'com.github.bumptech.glide:glide:4.3.1'

then in your activity use it like below

Glide.with(this\*your context*\).load(R.drawable.animated_gif).into((ImageView)findViewById(R.id.ImageViewId));
Code Demon
  • 1,256
  • 1
  • 9
  • 15
0

No its not possible with Material intro.Consider using another library like pl.droidsonroids.gif:android-gif-drawable on your Gradle have implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19'

Then on your xml

<pl.droidsonroids.gif.GifImageView
    android:id="@+id/gif_view"
    android:layout_width="40dp"
    android:layout_height="44dp"
    android:scaleType="fitXY"
    android:src="@drawable/yourgif">
Manaus
  • 407
  • 5
  • 9
Code Demon
  • 1,256
  • 1
  • 9
  • 15
0

Why don't you just insert GIFS with ImageView? You can follow instructions here.

LoukasPap
  • 1,244
  • 1
  • 8
  • 17
0

Using Glide

Glide.with(this)
.asGif()
.load("gifSourse")
.into(targetImageView);
SumOn
  • 306
  • 1
  • 4