Skip to content

Instantly share code, notes, and snippets.

@mdavalos1993
Last active June 10, 2020 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdavalos1993/474fd59511b1452df08e4c0d2c5392fa to your computer and use it in GitHub Desktop.
Save mdavalos1993/474fd59511b1452df08e4c0d2c5392fa to your computer and use it in GitHub Desktop.
Glide.with(this)
.load("imageUrl")
.into(object : CustomTarget<Drawable>(850, 850) {
override fun onLoadCleared(placeholder: Drawable?) {
// called when imageView is cleared. If you are referencing the bitmap
// somewhere else too other than this imageView clear it here
}
override fun onResourceReady(resource: Drawable, transition: Transition<in Drawable>?) {
img_view.setImageDrawable(resource)
//do any aditional action
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment