I would like to set the image using the Android Data Binding. I have read a lot of tutorials about this and the images still don't appear.
Inside my model I have the following method:
@BindingAdapter({"app:imageUrl"})
public static void loadImage(ImageView view, String url) {
Log.i("III", "Image - " + url);
Context context = view.getContext();
Glide.with(context).load(GlobalValues.img_start_url + url).into(view);
}
I also should mention that "III", "Image - " + url is never print so the problem is not with the Glide.
This is my xml:
<data>
<variable
name="feeling"
type="bg.web3.helpkarma.ViewModels.Feeling"/>
</data>
<ImageView
android:layout_width="wrap_content"
android:id="@+id/icon"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
app:imageUrl="@{feeling.maleIcon}"/>
and the maleIcon is a url String
@SerializedName("male_icon")
@Expose
private String maleIcon;