Include multiple same layout
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<include android:id="@+id/streakLayout" layout="@layout/dailyquote_content_topbar_item" />
<include android:id="@+id/pointLayout" layout="@layout/dailyquote_content_topbar_item" />
</LinearLayout>
res/layout/dailyquote_content_topbar_item
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:srcCompat="@drawable/yy_point_acorn"
/>
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="100"
/>
</LinearLayout>
Code
pointLayout.imageView.setImageResource(R.drawable.ic_add_black_24dp)pointLayout.textView.text = "Add"streakLayout.imageView.setImageResource(R.drawable.ic_check_black_24dp)streakLayout.textView.text = "Check"