BindingAdapter with multiple attributes in Android Data Binding

If you need a BindingAdapter with multiple attributes, it can be accomplished in the following way:

Create a BindingAdapter that has as many bindings as you need, in this case two:

@BindingAdapter({“bind:title”, “bind:plot”})
public static void movieData(TextView view, String title, String plot) {
Timber.d(title);
Timber.d(plot);
}

And then set all values in the xml:

<TextView
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
app:title=”@{movie.title}”
app:plot=”@{movie.plot}”
/>