Имеется отдельный фрагмент с Recycler View. Необходимо "включить (include)" в recycler view некоторые итемы, чтобы он их отображал. Как правильно это можно написать? Ниже код fragment'a с RecyclerView:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.example.android.CenteredToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/toolbarNotes"
android:background="@color/formRecyclerViewInMainRegistration" />
</RelativeLayout>
Ниже фрагмент item
, который должен отображаться в фрагменте
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/rlItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_notes_pick"
android:elevation="20dp">
<ImageView
android:id="@+id/ivBtnPlay"
android:layout_width="28dp"
android:layout_height="28dp"
android:layout_marginLeft="42dp"
android:layout_centerVertical="true"
android:clickable="true"
android:focusable="true"
android:src="@drawable/ic_play_button">
</ImageView>
</RelativeLayout>
</LinearLayout>