This has to be the most basic of question but after a full day of reading tutorials and the documentation here I can\'t seem to understand where to put these methods. None of th
You place it in your model class.
Example:
XML:
......
Model:
public class Model {
@DrawableRes
private final int resId;
public Model(int resId) {
this.resId = resId;
}
public int getResId() {
return resId;
}
@BindingAdapter ("android:src")
public static void setImageResource(ImageView imageView, int resource){
imageView.setImageResource(resource);
}
}