<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">

    <data>

        <import type="fr.iut.ouafff.ui.utils.Converters" />

        <variable
            name="dog"
            type="fr.iut.ouafff.data.Dog" />
    </data>

    <androidx.cardview.widget.CardView
        android:id="@+id/cardview_dog"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="2dp"
        card_view:cardBackgroundColor="@{Converters.aggressivenessToColor(context,dog.aggressiveness)}"
        card_view:cardUseCompatPadding="true">

        <LinearLayout
            android:id="@+id/layout_cardview_dog"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:padding="@dimen/activity_margin">

            <TextView
                android:id="@+id/view_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:fontFamily="sans-serif-medium"
                android:text="@{dog.name}"
                android:textAppearance="?android:textAppearanceMedium"
                android:textColor="@color/text_black"
                tools:text="Dog's Name" />

            <TextView
                android:id="@+id/view_breed"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@{dog.breed.empty ? @string/unknown_breed : dog.breed}"
                android:textAppearance="?android:textAppearanceSmall"
                android:textColor="@color/text_black_lighter"
                tools:text="Breed" />
        </LinearLayout>
    </androidx.cardview.widget.CardView>
</layout>