<?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>

        <import type="android.view.View" />

        <variable
            name="dogListVM"
            type="fr.iut.ouafff.ui.viewmodel.DogListViewModel" />
    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".ui.activity.DogListActivity">

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/recycler_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
            app:spanCount="2"
            tools:listitem="@layout/item_list_dog" />

        <androidx.constraintlayout.widget.Group
            android:id="@+id/group_empty_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:visibility="@{dogListVM.showEmptyView ? View.VISIBLE : View.GONE}"
            app:constraint_referenced_ids="shelter_icon,empty_view_title,empty_view_subtitle" />

        <ImageView
            android:id="@+id/shelter_icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:contentDescription="@string/empty_view_subtitle_text"
            android:src="@drawable/ic_empty_shelter"
            app:layout_constraintBottom_toTopOf="@+id/empty_view_title"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent" />

        <TextView
            android:id="@+id/empty_view_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:fontFamily="sans-serif-medium"
            android:paddingTop="@dimen/medium_space"
            android:text="@string/empty_view_title_text"
            android:textAppearance="?android:textAppearanceMedium"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:id="@+id/empty_view_subtitle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:fontFamily="sans-serif"
            android:paddingTop="@dimen/small_space"
            android:text="@string/empty_view_subtitle_text"
            android:textAppearance="?android:textAppearanceSmall"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/empty_view_title" />

        <com.google.android.material.floatingactionbutton.FloatingActionButton
            android:id="@+id/fab_add_dog"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/activity_margin"
            android:contentDescription="@string/new_dog_accessibility_text"
            android:src="@drawable/ic_add_pet"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintRight_toRightOf="parent" />
    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>