<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center_vertical"
    android:background="@drawable/list_item_selector">

    <View
        android:id="@+id/divider"
        android:background="@color/divider"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        android:layout_marginStart="84dp"
        android:layout_width="0dp"
        android:layout_height="1dp"/>

    <androidx.appcompat.widget.LinearLayoutCompat
        android:layout_width="0dp"
        android:orientation="vertical"
        android:id="@+id/text_layout"
        android:paddingTop="12dp"
        android:paddingBottom="12dp"
        android:paddingStart="84dp"
        android:paddingEnd="2dp"
        android:gravity="center"
        app:layout_constraintHeight_min="48dp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toStartOf="@id/download_button"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        android:layout_height="wrap_content">

        <com.google.android.material.textview.MaterialTextView
            android:id="@+id/title"
            style="?textAppearanceTitleSmall"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ellipsize="end"
            android:maxLines="1"
            tools:text="Chapter name"
            android:textColor="?attr/colorOnBackground"
            app:layout_constraintVertical_chainStyle="packed"/>

        <com.google.android.material.textview.MaterialTextView
            android:id="@+id/subtitle"
            style="?textAppearanceBodySmall"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            tools:text="Scan name"
            android:visibility="gone"
            tools:visibility="visible"
            android:ellipsize="end"
            android:maxLines="1"
            android:textColor="?android:attr/textColorSecondary"
            app:layout_constraintVertical_chainStyle="packed"/>
    </androidx.appcompat.widget.LinearLayoutCompat>

    <include
        android:id="@+id/download_button"
        layout="@layout/download_button"
        android:layout_width="45dp"
        android:layout_marginEnd="8dp"
        app:layout_constraintTop_toTopOf="@id/text_layout"
        app:layout_constraintBottom_toBottomOf="@id/text_layout"
        app:layout_constraintStart_toEndOf="@id/text_layout"
        app:layout_constraintEnd_toEndOf="parent"
        android:layout_height="wrap_content" />
</androidx.constraintlayout.widget.ConstraintLayout>