Ich habe eine recyclerview und ich möchte den Stil jedes Artikels der Recyclerview mit Databinding dynamisch ändern.Artikelstil der Recyclerview mit Datenbindung ändern
Das ist mein Recyclerview Artikel Layout
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/channel_priority_item_height"
android:background="@drawable/channel_item_bg"
android:paddingStart="@dimen/channel_priority_header_left_pad"
android:paddingEnd="@dimen/channel_priority_item_right_pad">
<ImageView
android:id="@+id/preference_channel_image"
android:src="@drawable/empty_channel_drawable"
android:layout_width="@dimen/channels_item_width"
android:layout_height="@dimen/channels_item_height"
android:layout_centerVertical="true"
android:layout_alignParentStart="true"
android:layout_marginEnd="@dimen/channel_item_margin_end"/>
<RelativeLayout
android:id="@+id/preference_channel_switch_holder"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true">
<ImageView
android:id="@+id/preference_channel_switch"
android:layout_width="@dimen/channels_preference_switch_size"
android:layout_height="@dimen/channels_preference_switch_size"
android:layout_centerInParent="true"
android:padding="@dimen/switch_padding"
android:src="@drawable/switch_selected_bg"
android:background="@drawable/circle_button_bg" />
</RelativeLayout>
<LinearLayout
android:orientation="vertical"
android:layout_toEndOf="@+id/preference_channel_image"
android:layout_toStartOf="@+id/preference_channel_switch_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true">
<TextView
android:text="Some Header"
android:id="@+id/channel_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/preference_channel_primary"
android:textColor="@color/white"
android:fontFamily="sans-serif"/>
<TextView
android:text="Some Description"
android:id="@+id/channel_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/preference_channel_secondary"
android:textColor="@color/white_50"
android:fontFamily="sans-serif"/>
</LinearLayout>
</RelativeLayout>
ich den Stil von jedes Element in diesem Layout, wie die Textfarbe des Textview Hintergrund des Layouts usw. Wo sollte die Datenbindung ändern möchten getan werden? Im Adapter oder im Elternfragment: Jedes Beispiel ist sehr hilfreich. Danke.