Closed wsdydeni closed 3 years ago
<FrameLayout
android:id="@+id/frameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<include layout="@layout/order_list" />
</FrameLayout>
How can i use binding for the layout that are included in my main layout file
<FrameLayout android:id="@+id/frameLayout" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <include layout="@layout/order_list" /> </FrameLayout>
How can i use binding for the layout that are included in my main layout file
@JayGajjar, if it's generic layout, without merge
, then assign id to the included layout:
<FrameLayout
android:id="@+id/frameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<include android:id="@+id/order_list" layout="@layout/order_list" />
</FrameLayout>
and use it how you would use binding with any other component:
binding.order_list...
The library doesn't add any code to a ViewBinding instance. For access included layout ViewBinding contains another instance of ViewBinding. That works in Android Studio 4.2
No details provided