<?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_margin="@dimen/card_margin">

  <androidx.constraintlayout.widget.ConstraintLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?selectableItemBackground"
    android:minHeight="?listPreferredItemHeight"
    android:orientation="horizontal"
    tools:ignore="Overdraw, RTLHardcoded">

    <ImageView
      android:id="@+id/libraryBookFavicon"
      android:layout_width="@dimen/favicon_width"
      android:layout_height="wrap_content"
      android:layout_marginStart="@dimen/activity_horizontal_margin"
      android:layout_marginEnd="@dimen/favicon_margin_right"
      android:adjustViewBounds="true"
      android:scaleType="fitCenter"
      android:src="@mipmap/ic_launcher"
      android:contentDescription="@string/fav_icon"
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toTopOf="parent"
      tools:ignore="RtlHardcoded" />

    <TextView
      android:id="@+id/libraryBookTitle"
      style="@style/list_item_title"
      android:layout_width="0dp"
      android:layout_height="wrap_content"
      android:layout_marginStart="@dimen/favicon_margin_right"
      android:layout_marginTop="@dimen/item_library_margin_top"
      android:layout_marginEnd="@dimen/activity_horizontal_margin"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toEndOf="@+id/libraryBookFavicon"
      app:layout_constraintTop_toTopOf="parent"
      tools:text="Title Title Title Title Title Title  Title Title Title  Title Title Title Title Title Title Title Title Title Title Title " />

    <TextView
      android:id="@+id/libraryBookDescription"
      style="@style/list_item_body"
      android:layout_width="0dp"
      android:layout_height="wrap_content"
      android:layout_marginEnd="@dimen/activity_horizontal_margin"
      android:ellipsize="end"
      android:maxLines="2"
      android:textColor="?textSecondary"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toStartOf="@+id/libraryBookTitle"
      app:layout_constraintTop_toBottomOf="@+id/libraryBookTitle"
      tools:text="Description a really really really really really really really really really really long descricption elipsisisisss" />


    <TextView
      android:id="@+id/libraryBookSize"
      style="@style/list_item_body.detail"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      app:layout_constraintEnd_toStartOf="@id/libraryBookDate"
      app:layout_constraintHorizontal_chainStyle="spread_inside"
      app:layout_constraintStart_toStartOf="@+id/libraryBookTitle"
      app:layout_constraintTop_toBottomOf="@+id/libraryBookDescription"
      tools:text="File Size File Size File Size File Size File Size File Size  File Size  File Size  File Size " />

    <TextView
      android:id="@+id/libraryBookDate"
      style="@style/list_item_body.detail.end"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toEndOf="@id/libraryBookSize"
      app:layout_constraintTop_toTopOf="@id/libraryBookSize"
      tools:text="Date Date Date Date Date  " />

    <TextView
      android:id="@+id/libraryBookCreator"
      style="@style/list_item_body.detail"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      app:layout_constraintEnd_toStartOf="@id/libraryBookLanguage"
      app:layout_constraintHorizontal_chainStyle="spread_inside"
      app:layout_constraintStart_toStartOf="@+id/libraryBookTitle"
      app:layout_constraintTop_toBottomOf="@+id/libraryBookSize"
      tools:text="Author" />

    <TextView
      android:id="@+id/libraryBookLanguage"
      style="@style/list_item_body.detail.end"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toEndOf="@id/libraryBookCreator"
      app:layout_constraintTop_toBottomOf="@+id/libraryBookDate"
      tools:text="Language" />

    <org.kiwix.kiwixmobile.core.zim_manager.TagsView
      android:id="@+id/tags"
      android:layout_width="0dp"
      android:layout_height="wrap_content"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toStartOf="@+id/libraryBookTitle"
      app:layout_constraintTop_toBottomOf="@id/libraryBookCreator" />


    <View
      android:id="@+id/unableToDownload"
      android:layout_width="0dp"
      android:layout_height="0dp"
      android:alpha=".5"
      android:contentDescription="@string/detecting_file_system"
      android:background="@color/pure_gray"
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toTopOf="parent"
      tools:visibility="gone" />
  </androidx.constraintlayout.widget.ConstraintLayout>

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