<?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"
	style="?materialCardViewFilledStyle"
	android:layout_width="match_parent"
	android:layout_height="wrap_content">

	<androidx.constraintlayout.widget.ConstraintLayout
		android:id="@+id/constraintLayout"
		android:layout_width="match_parent"
		android:layout_height="match_parent"
		android:paddingBottom="12dp">

		<com.google.android.material.imageview.ShapeableImageView
			android:id="@+id/imageView_cover"
			android:layout_width="64dp"
			android:layout_height="64dp"
			android:layout_marginStart="12dp"
			android:layout_marginTop="12dp"
			android:scaleType="centerCrop"
			app:layout_constraintStart_toStartOf="parent"
			app:layout_constraintTop_toTopOf="parent"
			app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Kotatsu.Cover.Medium"
			tools:src="@tools:sample/backgrounds/scenic" />

		<TextView
			android:id="@+id/textView_title"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:layout_marginStart="16dp"
			android:layout_marginTop="12dp"
			android:ellipsize="end"
			android:gravity="center_vertical"
			android:singleLine="true"
			android:textAppearance="?attr/textAppearanceTitleSmall"
			app:layout_constraintEnd_toStartOf="@id/imageView_expand"
			app:layout_constraintStart_toEndOf="@id/imageView_cover"
			app:layout_constraintTop_toTopOf="parent"
			app:layout_goneMarginEnd="12dp"
			tools:text="@tools:sample/lorem" />

		<org.koitharu.kotatsu.core.ui.widgets.CheckableImageView
			android:id="@+id/imageView_expand"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:background="?selectableItemBackgroundBorderless"
			android:minWidth="?minTouchTargetSize"
			android:minHeight="?minTouchTargetSize"
			android:scaleType="center"
			android:visibility="gone"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintTop_toTopOf="parent"
			app:srcCompat="@drawable/ic_expand_collapse"
			app:tint="?colorControlActivated"
			tools:visibility="visible" />

		<androidx.constraintlayout.widget.Barrier
			android:id="@+id/barrier_top"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			app:barrierDirection="bottom"
			app:constraint_referenced_ids="imageView_cover,textView_status,imageView_expand" />

		<com.google.android.material.progressindicator.LinearProgressIndicator
			android:id="@+id/progressBar"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:layout_marginStart="12dp"
			android:layout_marginTop="12dp"
			android:layout_marginEnd="12dp"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintStart_toStartOf="parent"
			app:layout_constraintTop_toBottomOf="@id/barrier_top"
			app:trackColor="?android:colorBackground"
			tools:progress="25" />

		<org.koitharu.kotatsu.core.ui.widgets.NestedRecyclerView
			android:id="@+id/recyclerView_chapters"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:layout_marginStart="12dp"
			android:layout_marginTop="12dp"
			android:layout_marginEnd="12dp"
			android:background="@drawable/bg_card"
			android:clipToOutline="true"
			android:clipToPadding="false"
			android:fadeScrollbars="false"
			android:nestedScrollingEnabled="false"
			android:orientation="vertical"
			android:outlineProvider="background"
			android:paddingVertical="8dp"
			android:scrollbarStyle="insideOverlay"
			android:scrollbars="vertical"
			android:visibility="gone"
			app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintStart_toStartOf="parent"
			app:layout_constraintTop_toBottomOf="@id/progressBar"
			app:maxHeight="240dp"
			tools:listitem="@layout/item_chapter_download"
			tools:visibility="visible" />

		<TextView
			android:id="@+id/textView_status"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:layout_marginStart="16dp"
			android:layout_marginTop="4dp"
			android:layout_marginEnd="12dp"
			android:ellipsize="end"
			android:singleLine="true"
			android:textAppearance="?attr/textAppearanceBodySmall"
			app:layout_constraintEnd_toStartOf="@id/textView_percent"
			app:layout_constraintStart_toEndOf="@id/imageView_cover"
			app:layout_constraintTop_toBottomOf="@id/textView_title"
			tools:text="@string/manga_downloading_" />

		<TextView
			android:id="@+id/textView_percent"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_marginEnd="12dp"
			android:layout_marginBottom="12dp"
			android:textAppearance="?attr/textAppearanceBodyMedium"
			app:layout_constraintBottom_toTopOf="@id/barrier_top"
			app:layout_constraintEnd_toEndOf="parent"
			tools:text="25%" />

		<TextView
			android:id="@+id/textView_details"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:layout_marginStart="16dp"
			android:layout_marginTop="4dp"
			android:layout_marginEnd="12dp"
			android:ellipsize="end"
			android:maxLines="4"
			android:textAppearance="?attr/textAppearanceBodySmall"
			app:layout_constraintEnd_toStartOf="@id/textView_percent"
			app:layout_constraintStart_toEndOf="@id/imageView_cover"
			app:layout_constraintTop_toBottomOf="@id/textView_status"
			tools:text="@tools:sample/lorem[3]" />

		<Button
			android:id="@+id/button_pause"
			style="?materialButtonOutlinedStyle"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_marginTop="8dp"
			android:layout_marginEnd="12dp"
			android:text="@string/pause"
			android:visibility="gone"
			app:layout_constraintEnd_toStartOf="@id/button_resume"
			app:layout_constraintTop_toBottomOf="@id/recyclerView_chapters"
			tools:visibility="gone" />

		<Button
			android:id="@+id/button_resume"
			style="?materialButtonOutlinedStyle"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_marginTop="8dp"
			android:layout_marginEnd="12dp"
			android:text="@string/resume"
			android:visibility="gone"
			app:layout_constraintEnd_toStartOf="@id/button_cancel"
			app:layout_constraintTop_toBottomOf="@id/recyclerView_chapters"
			tools:visibility="visible" />

		<Button
			android:id="@+id/button_skip"
			style="?materialButtonOutlinedStyle"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_marginTop="8dp"
			android:layout_marginEnd="12dp"
			android:text="@string/skip"
			android:visibility="gone"
			app:layout_constraintEnd_toStartOf="@id/button_resume"
			app:layout_constraintTop_toBottomOf="@id/recyclerView_chapters"
			tools:visibility="visible" />

		<Button
			android:id="@+id/button_cancel"
			style="?materialButtonOutlinedStyle"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_marginTop="8dp"
			android:layout_marginEnd="12dp"
			android:text="@android:string/cancel"
			android:visibility="gone"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintTop_toBottomOf="@id/recyclerView_chapters"
			tools:visibility="visible" />

	</androidx.constraintlayout.widget.ConstraintLayout>

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