Skip to content

Instantly share code, notes, and snippets.

@dmitry-zaitsev
Created October 2, 2015 11:57
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 dmitry-zaitsev/b03ca967ec1a455372d5 to your computer and use it in GitHub Desktop.
Save dmitry-zaitsev/b03ca967ec1a455372d5 to your computer and use it in GitHub Desktop.
package net.anichart.ui.util.Binding;
import android.databinding.BindingAdapter;
import android.widget.ImageView;
import com.squareup.picasso.Picasso;
/**
* Binds image related properties
*/
public class ImageBindingAdapter {
@BindingAdapter("bind:imageUrl")
public static void loadImage(ImageView view, String url) {
Picasso.with(view.getContext())
.load(url)
.into(view);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment