<?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"
	app:cardCornerRadius="16dp">

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

		<com.google.android.material.imageview.ShapeableImageView
			android:id="@+id/imageView_cover"
			android:layout_width="98dp"
			android:layout_height="0dp"
			android:scaleType="centerCrop"
			app:layout_constraintDimensionRatio="13:18"
			app:layout_constraintStart_toStartOf="parent"
			app:layout_constraintTop_toTopOf="parent"
			app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Kotatsu.Cover"
			tools:src="@sample/covers" />

		<org.koitharu.kotatsu.history.ui.util.ReadingProgressView
			android:id="@+id/progressView"
			android:layout_width="@dimen/card_indicator_size"
			android:layout_height="@dimen/card_indicator_size"
			android:layout_margin="@dimen/card_indicator_offset"
			app:layout_constraintBottom_toBottomOf="@id/imageView_cover"
			app:layout_constraintEnd_toEndOf="@id/imageView_cover" />

		<TextView
			android:id="@+id/textView_title"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:layout_marginStart="12dp"
			android:layout_marginTop="12dp"
			android:layout_marginEnd="12dp"
			android:ellipsize="end"
			android:maxLines="2"
			android:textAppearance="?attr/textAppearanceTitleLarge"
			android:textSize="20sp"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintStart_toEndOf="@+id/imageView_cover"
			app:layout_constraintTop_toTopOf="parent"
			tools:text="@sample/titles" />

		<TextView
			android:id="@+id/textView_subtitle"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:layout_marginStart="12dp"
			android:layout_marginTop="8dp"
			android:layout_marginEnd="12dp"
			android:ellipsize="end"
			android:gravity="center_vertical"
			android:maxLines="2"
			android:textAppearance="?attr/textAppearanceSubtitle1"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintStart_toEndOf="@+id/imageView_cover"
			app:layout_constraintTop_toBottomOf="@+id/textView_title"
			tools:text="@tools:sample/lorem/random" />

		<HorizontalScrollView
			android:id="@+id/scrollView_tags"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:layout_marginStart="12dp"
			android:layout_marginTop="8dp"
			android:layout_marginEnd="12dp"
			android:layout_marginBottom="8dp"
			android:scrollIndicators="start|end"
			android:scrollbars="none"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintStart_toEndOf="@+id/imageView_cover"
			app:layout_constraintTop_toBottomOf="@id/textView_subtitle"
			app:layout_goneMarginTop="12dp"
			tools:ignore="UnusedAttribute">

			<org.koitharu.kotatsu.base.ui.widgets.ChipsView
				android:id="@+id/chips_tags"
				android:layout_width="wrap_content"
				android:layout_height="wrap_content"
				app:chipSpacingHorizontal="6dp"
				app:chipSpacingVertical="6dp"
				app:singleLine="true" />
		</HorizontalScrollView>

		<RatingBar
			android:id="@+id/ratingBar"
			style="?android:ratingBarStyleSmall"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:isIndicator="true"
			android:paddingVertical="8dp"
			app:layout_constraintEnd_toEndOf="@id/imageView_cover"
			app:layout_constraintStart_toStartOf="@id/imageView_cover"
			app:layout_constraintTop_toBottomOf="@id/imageView_cover" />

		<ImageView
			android:id="@+id/button_read"
			android:layout_width="48dp"
			android:layout_height="48dp"
			android:layout_marginTop="12dp"
			android:layout_marginEnd="12dp"
			android:layout_marginBottom="12dp"
			android:background="@drawable/bg_circle_button"
			android:contentDescription="@string/read"
			android:scaleType="center"
			android:src="@drawable/ic_read"
			app:layout_constraintBottom_toBottomOf="parent"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintTop_toBottomOf="@id/scrollView_tags"
			app:layout_constraintVertical_bias="1" />

	</androidx.constraintlayout.widget.ConstraintLayout>

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