Last active
April 22, 2019 10:52
-
-
Save Philio/f54595304e2503a2d84da90828a37e8f to your computer and use it in GitHub Desktop.
This file contains 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
public class ImageBindingAdapter { | |
private final Picasso picasso; | |
public ImageBindingAdapter(Picasso picasso) { | |
this.picasso = picasso; | |
} | |
@BindingAdapter("android:src") | |
public void loadImage(ImageView view, String url) { | |
picasso.load(url).fit().into(view); | |
} | |
} |
This file contains 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
class ImageBindingAdapter(val picasso: Picasso) { | |
@BindingAdapter("android:src") | |
fun loadImage(view: ImageView, url: String) { | |
picasso.load(url).fit().into(view) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment