<?xml version="1.0" encoding="utf-8"?>
<layout 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">

    <data>

        <variable
            name="cover"
            type="String" />

        <variable
            name="name"
            type="String" />

    </data>

    <androidx.cardview.widget.CardView
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_marginStart="@dimen/dp4"
        android:layout_marginTop="@dimen/dp4"
        android:layout_marginEnd="@dimen/dp4"
        android:layout_marginBottom="@dimen/dp4"
        android:focusable="true"
        android:foreground="?selectableItemBackground"
        android:gravity="center"
        app:cardBackgroundColor="#FFF"
        app:cardCornerRadius="@dimen/dp8"
        app:cardElevation="0dp"
        app:cardPreventCornerOverlap="true"
        app:cardUseCompatPadding="true"
        app:contentPadding="0dp">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent">

            <androidx.appcompat.widget.AppCompatImageView
                android:id="@+id/unit_cover"
                android:layout_width="@dimen/dp180"
                android:layout_height="match_parent"
                android:scaleType="fitXY"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:load="@{cover}"
                tools:srcCompat="@tools:sample/backgrounds/scenic" />

            <androidx.appcompat.widget.AppCompatTextView
                android:id="@+id/item_name"
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:background="@color/colorMasking"
                android:gravity="center"
                android:maxLines="1"
                android:text="@{name}"
                android:textAlignment="center"
                android:textAllCaps="false"
                android:textColor="@color/colorWhite"
                app:autoSizeTextType="uniform"
                app:layout_constraintHeight_percent="0.2"
                app:layout_constraintVertical_bias="1"
                app:layout_constraintBottom_toBottomOf="@id/unit_cover"
                app:layout_constraintEnd_toEndOf="@id/unit_cover"
                app:layout_constraintStart_toStartOf="@id/unit_cover"
                app:layout_constraintTop_toTopOf="@id/unit_cover"
                tools:text="@tools:sample/full_names" />

        </androidx.constraintlayout.widget.ConstraintLayout>

    </androidx.cardview.widget.CardView>

</layout>
