<?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/constraint_layout"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:background="@drawable/library_grid_selector">

    <com.google.android.material.card.MaterialCardView
        android:id="@+id/card"
        android:layout_width="112dp"
        android:layout_height="168dp"
        android:layout_gravity="bottom"
        android:layout_marginStart="6dp"
        android:layout_marginTop="6dp"
        android:layout_marginEnd="6dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="1.0">

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

        <com.google.android.material.progressindicator.CircularProgressIndicator
            android:id="@+id/progress"
            android:indeterminate="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:visibility="gone"
            app:indicatorSize="16dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:trackThickness="3dp" />

    </com.google.android.material.card.MaterialCardView>

    <com.google.android.material.card.MaterialCardView
        android:id="@+id/favorite_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:cardCornerRadius="10dp"
        app:cardBackgroundColor="?attr/colorSecondary"
        app:cardElevation="2dp"
        android:layout_marginTop="3dp"
        android:layout_marginStart="3dp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent">

        <com.google.android.material.textview.MaterialTextView
            android:layout_width="wrap_content"
            android:gravity="center"
            android:maxLines="1"
            android:paddingStart="5dp"
            android:paddingEnd="5dp"
            android:textSize="13sp"
            android:textColor="?attr/colorOnSecondary"
            style="?textAppearanceCaption"
            android:layout_height="wrap_content"
            android:tint="@color/md_white_1000"
            android:text="@string/in_library"/>

    </com.google.android.material.card.MaterialCardView>

    <com.google.android.material.textview.MaterialTextView
        android:id="@+id/title"
        style="?textAppearanceBodyMedium"
        android:layout_width="110dp"
        android:layout_height="wrap_content"
        android:ellipsize="end"
        android:maxLines="1"
        android:textColor="?attr/colorOnBackground"
        android:textSize="12sp"
        app:layout_constrainedHeight="true"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/card"
        tools:text="Sample name" />

</androidx.constraintlayout.widget.ConstraintLayout>
