Skip to content

Instantly share code, notes, and snippets.

@etonotieno
Created January 28, 2019 09:02
Show Gist options
  • Save etonotieno/250db5b616f44c8fcd84f21bcc3ee5a6 to your computer and use it in GitHub Desktop.
Save etonotieno/250db5b616f44c8fcd84f21bcc3ee5a6 to your computer and use it in GitHub Desktop.
@BindingAdapter("image", "placeholderImage", "errorImage", requireAll=true)
fun loadImageForView(view: ImageView, imageUrl: String, errorImage: Drawable, placeholderImage: Drawable) {
Picasso.get().load(imageUrl).placeholder(placeholderImage).error(errorImage).into(view)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment