<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView 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="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginHorizontal="12dp"
    android:layout_marginVertical="6dp"
    android:clickable="true"
    android:focusable="true"
    android:foreground="?selectableItemBackground"
    app:cardElevation="4dp">

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

        <TextView
            android:id="@+id/dashboard_homework_item_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:layout_marginTop="16dp"
            android:drawablePadding="8dp"
            android:text="@string/dashboard_homework_title"
            android:textSize="18sp"
            android:textStyle="bold"
            app:drawableStartCompat="@drawable/ic_more_homework"
            app:drawableTint="?colorOnSurface"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/dashboard_homework_item_recycler"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginHorizontal="16dp"
            android:layout_marginTop="2dp"
            android:layout_marginBottom="16dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/dashboard_homework_item_title"
            app:layout_constraintVertical_bias="0"
            tools:itemCount="5"
            tools:listitem="@layout/subitem_dashboard_homework" />

        <View
            android:id="@+id/dashboard_homework_item_divider"
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:layout_marginHorizontal="16dp"
            android:layout_marginTop="8dp"
            android:background="?colorDivider"
            app:layout_constraintTop_toBottomOf="@id/dashboard_homework_item_recycler" />

        <TextView
            android:id="@+id/dashboard_homework_item_more"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginHorizontal="16dp"
            android:layout_marginTop="8dp"
            android:layout_marginBottom="16dp"
            android:fontFamily="sans-serif-medium"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/dashboard_homework_item_divider"
            tools:text="Jeszcze 5 zadań więcej" />

        <TextView
            android:id="@+id/dashboard_homework_item_empty"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:layout_marginTop="16dp"
            android:layout_marginBottom="16dp"
            android:text="@string/dashboard_homework_no_homework"
            android:textSize="14sp"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/dashboard_homework_item_title" />

        <TextView
            android:id="@+id/dashboard_homework_item_error"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:layout_marginTop="16dp"
            android:layout_marginEnd="16dp"
            android:layout_marginBottom="16dp"
            android:gravity="center_vertical"
            android:drawablePadding="8dp"
            android:text="@string/dashboard_homework_error"
            android:textColor="?colorError"
            android:textSize="14sp"
            android:visibility="gone"
            app:drawableStartCompat="@drawable/ic_error"
            app:drawableTint="?colorError"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/dashboard_homework_item_title" />

        <com.google.android.material.progressindicator.CircularProgressIndicator
            android:id="@+id/dashboard_homework_item_progress"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:layout_marginBottom="16dp"
            android:indeterminate="true"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/dashboard_homework_item_title" />
    </androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>