Google documentation says that variables may be passed into an included layout's binding from the containing layout but I can't make it work but get data binding error ****msg:Identifiers must have user defined types from the XML file. handler is missing it. The including XML looks like this:
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:bind="http://schemas.android.com/apk/res-auto">
<data>
<import type="com.example.FocusChangeHandler"/>
<variable
name="handler"
type="FocusChangeHandler"/>
</data>
<!-- Some other views --->
<include
android:id="@+id/inputs"
layout="@layout/input_fields"
bind:handler="@{handler}"/>
</layout>
And the included XML like this:
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<EditText
android:id="@+id/nameEdit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onFocusChange="@{handler.onFocusChange}"/>
</layout>
I'm able to refer the Views from included layout through generated binding class but passing a variable just doesn't work.