Skip to content

Instantly share code, notes, and snippets.

@ismailgungor
Last active April 3, 2019 15:53
Show Gist options
  • Save ismailgungor/59b37cf142f6b5c28b400a321f055f3d to your computer and use it in GitHub Desktop.
Save ismailgungor/59b37cf142f6b5c28b400a321f055f3d to your computer and use it in GitHub Desktop.
class GlideImageHelper(context: Context) : IImageProcess {
private val mGlideInstance = Glide.with(context)
override fun loadUrl(url: String, targetView: ImageView) {
mGlideInstance.load(url).into(targetView)
}
override fun loadUri(uri: Uri, targetView: ImageView) {
mGlideInstance.load(uri).into(targetView)
}
override fun loadUrlWithPlaceHolder(url: String,
targetView: ImageView,
placeHolderRes: Int) {
mGlideInstance.load(url).placeholder(placeHolderRes).into(targetView)
}
override fun loadUrlWithError(url: String,
targetView: ImageView,
errorImageRes: Int) {
mGlideInstance.load(url).error(errorImageRes).into(targetView)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment