Suppose I have a custom setter method where I need two arguments:
@BindingAdapter({"imageUrl", "placeholder"})
public static void loadImage(ImageView imageView, String imageUrl, Drawable drawable) {
Picasso.with(imageView.getContext()).load(imageUrl).placeholder(drawable).into(imageView);
}
What would the corresponding xml look like?
Looks like it can be done like this:
<ImageView app:imageUrl=“@{data.imageUrl}”
app:placeholder=“@{@drawable/placeholder}”/>
see http://developer.android.com/intl/es/tools/data-binding/guide.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With