Created
April 19, 2017 08:16
-
-
Save babedev/f45ca0b56d2da0239b3f0d0dd4c74c8a to your computer and use it in GitHub Desktop.
ImageView extension for show image with Glide
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun ImageView.show(imageUrl: String = "") { | |
if (context == null) return | |
if (context is Activity && ((context as Activity).isFinishing || (context as Activity).isDestroyed)) return | |
Glide.with(context) | |
.load(imageUrl) | |
.crossFade() | |
.signature(StringSignature(UUID.randomUUID().toString())) | |
.into(this) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment