I'm using Two Adapter with data Binding implements and One Specific item layout for each adapter,However I used One Data Model Type for Two of them...is this really possible? is it Okay for standard coding? Because i get error in one of generated Data Binding Classes
My Main Question Is: is it Standard in pattern of DataBinding or even its a good practice or not?And Why?
ERROR : error: cannot find symbol import packageName.ItemCheckStepsBindingImpl;
My Adapter Item Layout :
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="checkSteps"
type="packageName.data.model.Steps"/>//in this Line i'm using again in another Item layout
</data>
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="@color/white"
app:cardElevation="8dp"
style="@style/MyCard"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="2">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/user_confirm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
android:layout_margin="@dimen/inner_margin"
android:layout_weight=".1"
app:srcCompat="@drawable/ic_check_green_24dp"
android:visibility="invisible"
/>
<LinearLayout
android:id="@+id/container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/inner_margin"
android:orientation="vertical"
android:layout_gravity="right"
android:layout_weight="1.8"
>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:text='@{steps.title}'
style="@style/HeadTextView"
android:layout_margin="@dimen/inner_margin"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:text='@{steps.description}'
style="@style/BodyTextView"
android:layout_margin="@dimen/inner_margin"
/>
</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</layout>
My Second Adapter Item :
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="steps"
type="com.isatelco.diettrainer.data.model.Steps"/>
</data>
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="@color/white"
app:cardElevation="8dp"
style="@style/MyCard"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="2">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/deleteStep"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight=".1"
android:layout_gravity="center_vertical"
app:srcCompat="@drawable/ic_clear_red_24dp"
/>
<LinearLayout
android:id="@+id/container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/inner_margin"
android:orientation="vertical"
android:layout_gravity="right"
android:layout_weight="1.8"
>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:text='@{steps.title}'
style="@style/HeadTextView"
android:layout_margin="@dimen/inner_margin"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:text='@{steps.description}'
style="@style/BodyTextView"
android:layout_margin="@dimen/inner_margin"
/>
</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</layout>