Skip to content

Instantly share code, notes, and snippets.

@eufelipe
Last active July 24, 2017 17:48
Show Gist options
  • Save eufelipe/e634ef3207a573620ead18fbe12089ed to your computer and use it in GitHub Desktop.
Save eufelipe/e634ef3207a573620ead18fbe12089ed to your computer and use it in GitHub Desktop.
public final class DataBinder {
private DataBinder() {
}
@BindingAdapter("android:src")
public static void setImageUrl(final ImageView imageView, String url) {
Context context = imageView.getContext();
Picasso.with(context)
.load(url)
.placeholder(R.mipmap.ic_no_image)
.into(imageView);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment