I was using version 3.8.0 and after upgrading to 4.2.0 I could not carry the following commands for the new version. I could not find the necessary steps:
Image with progress and cache function
Glide.with(context)
.load(url)
.diskCacheStrategy(DiskCacheStrategy.SOURCE)
.dontAnimate()
.listener(object : RequestListener<String, GlideDrawable> {
override fun onException(e: Exception?, model: String?,
target: Target<GlideDrawable>?,
isFirstResource: Boolean): Boolean {
TimberHelper.e(AppConstants.ERROR, "setGameImage - onException " + e.toString())
if (itemView.progressBar != null) {
itemView.progressBar!!.visibility = View.VISIBLE
}
return false
}
override fun onResourceReady(resource: GlideDrawable?,
model: String?,
target: Target<GlideDrawable>?,
isFromMemoryCache: Boolean,
isFirstResource: Boolean): Boolean {
if (itemView.progressBar != null) {
itemView.progressBar!!.visibility = View.GONE
}
return false
}
})
.into(itemView.ivGameImage)
Load Bitmap with this configuration:
Glide.
with(this).
load(image).
asBitmap().diskCacheStrategy(DiskCacheStrategy.ALL).
centerCrop().
dontAnimate().
override(1080, 675).
into(object : BitmapImageViewTarget(ivToolbarGame) {
})
Have you read this? http://bumptech.github.io/glide/doc/migrating.html
This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.
Most helpful comment
Have you read this? http://bumptech.github.io/glide/doc/migrating.html