View Binding got released with v3.6.
Docs: https://developer.android.com/topic/libraries/view-binding
My question is, does anyone know how to use view binding with included layouts?
Given Layout that includes another Layout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="@+id/my_header"
layout="@layout/item_header"
android:layout_width="match_parent"
android:layout_height="100dp" />
</LinearLayout>
I am trying to reference items inside of the item_header layout.
binder.my_header (<-- this just returns back the view)
binder.root (<-- this just returns back the root view)
Even if I add an id to the root of the item_header, such as id="@+id/parent_id" and try to reference that, I receive null pointer exceptions
binder.parentId (<-- I have access to views inside of the item_header, however, I receive exceptions. Says that "parentId" cannot be found)
How to reference the layout, item_header
?