6

I'm using Glide library to load GIF files into my app. Here is what I implemented:

Glide.with(context)
     .load(stringImage)
     .asGif()
     .diskCacheStrategy(DiskCacheStrategy.SOURCE)
     .into(postImage);

But for some reason the GIF files are loading with very slow frame. I tried to Google but I wasn't able to figure it out.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Amazing Thing
  • 155
  • 2
  • 11

2 Answers2

2

Adding crossfade on local image drawable worked for me.

Glide.with(context).load(stringImage).asGif()
   .crossFade().diskCacheStrategy(DiskCacheStrategy.SOURCE).into(postImage);
Roshana Pitigala
  • 8,437
  • 8
  • 49
  • 80
Chinthaka Devinda
  • 997
  • 5
  • 16
  • 36
0

Yes, it worked for me too...

Glide.with(MainActivity.this)
                        .load(sticker.getImageUrl())
                        .placeholder(R.drawable.ic_placeholder)
                        .error(R.drawable.ic_error)
                        .crossFade().diskCacheStrategy(DiskCacheStrategy.SOURCE)
                        .into(imgView);
Rhea
  • 1