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.
Adding crossfade on local image drawable worked for me.
Glide.with(context).load(stringImage).asGif()
.crossFade().diskCacheStrategy(DiskCacheStrategy.SOURCE).into(postImage);
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);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.