<?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:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginVertical="4dp"
    android:background="@drawable/library_item_selector"
    android:padding="4dp">

    <FrameLayout
        android:id="@+id/card"
        android:layout_width="112dp"
        android:layout_height="144dp"
        android:background="@drawable/rounded_rectangle"
        app:layout_constraintDimensionRatio="h,5:7"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <com.google.android.material.progressindicator.CircularProgressIndicator
            android:id="@+id/progress"
            style="@style/Widget.Tachiyomi.CircularProgressIndicator.Small"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:indeterminate="true"
            android:visibility="gone" />

        <ImageView
            android:id="@+id/cover"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="?attr/colorSurface"
            android:scaleType="centerCrop"
            tools:ignore="ContentDescription"
            tools:src="@mipmap/ic_launcher" />

        <LinearLayout
            android:id="@+id/badges"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="4dp"
            android:layout_marginTop="4dp"
            android:background="@drawable/rounded_rectangle">

            <TextView
                android:id="@+id/favorite_text"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="?attr/colorSecondary"
                android:maxLines="1"
                android:paddingStart="3dp"
                android:paddingTop="1dp"
                android:paddingEnd="3dp"
                android:paddingBottom="1dp"
                android:text="@string/in_library"
                android:textAppearance="?attr/textAppearanceCaption"
                android:textColor="?attr/colorOnSecondary"
                android:visibility="gone"
                tools:visibility="visible" />

        </LinearLayout>

    </FrameLayout>

    <TextView
        android:id="@+id/title"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:ellipsize="end"
        android:maxLines="2"
        android:padding="4dp"
        android:textAppearance="?attr/textAppearanceSubtitle2"
        android:textSize="12sp"
        app:layout_constraintEnd_toEndOf="@+id/card"
        app:layout_constraintStart_toStartOf="@+id/card"
        app:layout_constraintTop_toBottomOf="@+id/card"
        tools:text="Sample name" />

</androidx.constraintlayout.widget.ConstraintLayout>


