In my app I download an image from an URL and set it into an ImageView through Glide, however, I\'m trying to remove a few unnecessary layouts, so is it possible to use Glide to
Here is a simple example of how to do using Kotlin.
GlideApp.with(context)
.load("url")
.placeholder(R.drawable.your_placeholder)
.error(R.drawable.your_error_image)
.into(object : CustomTarget(100, 100) {
override fun onLoadCleared(drawable: Drawable?) {
header.companyLogoJob.setCompoundDrawablesWithIntrinsicBounds(drawable,null,null,null)
}
override fun onResourceReady(res: Drawable, transition: com.bumptech.glide.request.transition.Transition?) {
header.companyLogoJob.setCompoundDrawablesWithIntrinsicBounds(res,null,null,null)
}
})