<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
	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:id="@+id/scrollView"
	android:layout_width="match_parent"
	android:layout_height="match_parent"
	android:clipToPadding="false"
	android:scrollIndicators="top"
	android:scrollbars="vertical"
	app:layout_behavior="@string/appbar_scrolling_view_behavior">

	<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="0dp"
			android:layout_height="0dp"
			android:layout_marginStart="16dp"
			android:layout_marginTop="16dp"
			android:background="?colorSecondaryContainer"
			android:foreground="?selectableItemBackground"
			android:scaleType="centerCrop"
			app:layout_constraintDimensionRatio="H,13:18"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintHorizontal_bias="0"
			app:layout_constraintStart_toStartOf="parent"
			app:layout_constraintTop_toTopOf="parent"
			app:layout_constraintWidth_percent="0.3"
			app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Kotatsu.Cover"
			tools:background="@tools:sample/backgrounds/scenic[5]"
			tools:ignore="ContentDescription,UnusedAttribute" />

		<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="16dp"
			android:layout_marginTop="16dp"
			android:layout_marginEnd="16dp"
			android:ellipsize="end"
			android:maxLines="5"
			android:textAppearance="?attr/textAppearanceHeadlineSmall"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintStart_toEndOf="@id/imageView_cover"
			app:layout_constraintTop_toTopOf="parent"
			tools:text="@tools:sample/lorem" />

		<TextView
			android:id="@+id/textView_subtitle"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:layout_marginStart="16dp"
			android:layout_marginTop="4dp"
			android:layout_marginEnd="16dp"
			android:ellipsize="end"
			android:maxLines="3"
			android:textAppearance="?attr/textAppearanceBodyMedium"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintStart_toEndOf="@id/imageView_cover"
			app:layout_constraintTop_toBottomOf="@id/textView_title"
			tools:text="@tools:sample/lorem[12]" />

		<TextView
			android:id="@+id/textView_author"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:layout_marginStart="16dp"
			android:layout_marginTop="4dp"
			android:layout_marginEnd="16dp"
			android:background="@drawable/list_selector"
			android:padding="2dp"
			android:singleLine="true"
			android:textColor="?attr/colorTertiary"
			android:textStyle="bold"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintHorizontal_bias="0"
			app:layout_constraintStart_toEndOf="@id/imageView_cover"
			app:layout_constraintTop_toBottomOf="@id/textView_subtitle"
			app:layout_constraintWidth_default="wrap"
			tools:text="@tools:sample/full_names" />

		<RatingBar
			android:id="@+id/rating_bar"
			style="?ratingBarStyleSmall"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_marginStart="16dp"
			android:layout_marginTop="4dp"
			android:layout_marginEnd="16dp"
			android:isIndicator="true"
			android:max="1"
			android:numStars="5"
			android:stepSize="0.5"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintHorizontal_bias="0.0"
			app:layout_constraintStart_toEndOf="@id/imageView_cover"
			app:layout_constraintTop_toBottomOf="@id/textView_author"
			tools:rating="4" />

		<androidx.constraintlayout.widget.Barrier
			android:id="@+id/barrier_header"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			app:barrierDirection="bottom"
			app:barrierMargin="8dp"
			app:constraint_referenced_ids="imageView_cover,rating_bar" />

		<include
			android:id="@+id/info_layout"
			layout="@layout/layout_details_info"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintStart_toStartOf="parent"
			app:layout_constraintTop_toBottomOf="@id/barrier_header" />

		<org.koitharu.kotatsu.core.ui.widgets.ChipsView
			android:id="@+id/chips_tags"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:layout_marginTop="8dp"
			android:paddingStart="16dp"
			android:paddingEnd="16dp"
			app:chipSpacingHorizontal="6dp"
			app:chipSpacingVertical="6dp"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintStart_toStartOf="parent"
			app:layout_constraintTop_toBottomOf="@+id/info_layout" />

		<TextView
			android:id="@+id/textView_description_title"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:layout_marginStart="@dimen/margin_small"
			android:layout_marginTop="@dimen/margin_small"
			android:layout_weight="1"
			android:gravity="center_vertical|start"
			android:padding="@dimen/grid_spacing"
			android:singleLine="true"
			android:text="@string/description"
			android:textAppearance="@style/TextAppearance.Kotatsu.SectionHeader"
			app:layout_constraintEnd_toStartOf="@id/button_description_more"
			app:layout_constraintStart_toStartOf="parent"
			app:layout_constraintTop_toBottomOf="@id/chips_tags" />

		<Button
			android:id="@+id/button_description_more"
			style="@style/Widget.Kotatsu.Button.More"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_marginEnd="8dp"
			android:text="@string/more"
			app:layout_constraintBaseline_toBaselineOf="@id/textView_description_title"
			app:layout_constraintEnd_toEndOf="parent" />

		<org.koitharu.kotatsu.core.ui.widgets.SelectableTextView
			android:id="@+id/textView_description"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:layout_marginStart="@dimen/margin_normal"
			android:layout_marginTop="@dimen/margin_small"
			android:layout_marginEnd="@dimen/margin_normal"
			android:ellipsize="end"
			android:lineSpacingMultiplier="1.2"
			android:maxLines="@integer/details_description_lines"
			android:paddingBottom="@dimen/margin_normal"
			android:textAppearance="?attr/textAppearanceBodyMedium"
			android:textIsSelectable="true"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintStart_toStartOf="parent"
			app:layout_constraintTop_toBottomOf="@id/textView_description_title"
			tools:ignore="UnusedAttribute"
			tools:text="@tools:sample/lorem/random" />

		<TextView
			android:id="@+id/textView_bookmarks_title"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:layout_marginStart="@dimen/margin_small"
			android:layout_marginTop="@dimen/margin_small"
			android:layout_weight="1"
			android:gravity="center_vertical|start"
			android:padding="@dimen/grid_spacing"
			android:singleLine="true"
			android:text="@string/bookmarks"
			android:textAppearance="@style/TextAppearance.Kotatsu.SectionHeader"
			app:layout_constraintEnd_toStartOf="@id/button_bookmarks_more"
			app:layout_constraintStart_toStartOf="parent"
			app:layout_constraintTop_toBottomOf="@id/textView_description" />

		<Button
			android:id="@+id/button_bookmarks_more"
			style="@style/Widget.Kotatsu.Button.More"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_marginEnd="8dp"
			android:text="@string/show_all"
			app:layout_constraintBaseline_toBaselineOf="@id/textView_bookmarks_title"
			app:layout_constraintEnd_toEndOf="parent" />

		<androidx.recyclerview.widget.RecyclerView
			android:id="@+id/recyclerView_bookmarks"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:layout_marginBottom="6dp"
			android:clipToPadding="false"
			android:nestedScrollingEnabled="false"
			android:orientation="horizontal"
			android:paddingStart="12dp"
			android:paddingEnd="12dp"
			app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintStart_toStartOf="parent"
			app:layout_constraintTop_toBottomOf="@id/textView_bookmarks_title"
			tools:listitem="@layout/item_bookmark" />

		<TextView
			android:id="@+id/textView_scrobbling_title"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:layout_marginStart="@dimen/margin_small"
			android:layout_marginTop="@dimen/margin_small"
			android:layout_weight="1"
			android:gravity="center_vertical|start"
			android:padding="@dimen/grid_spacing"
			android:singleLine="true"
			android:text="@string/tracking"
			android:textAppearance="@style/TextAppearance.Kotatsu.SectionHeader"
			app:layout_constraintEnd_toStartOf="@id/button_scrobbling_more"
			app:layout_constraintStart_toStartOf="parent"
			app:layout_constraintTop_toBottomOf="@id/recyclerView_bookmarks" />

		<Button
			android:id="@+id/button_scrobbling_more"
			style="@style/Widget.Kotatsu.Button.More"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_marginEnd="8dp"
			android:text="@string/manage"
			app:layout_constraintBaseline_toBaselineOf="@id/textView_scrobbling_title"
			app:layout_constraintEnd_toEndOf="parent" />

		<androidx.recyclerview.widget.RecyclerView
			android:id="@+id/recyclerView_scrobbling"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:layout_marginStart="16dp"
			android:layout_marginEnd="16dp"
			android:layout_marginBottom="12dp"
			android:nestedScrollingEnabled="false"
			android:orientation="vertical"
			android:overScrollMode="never"
			android:scrollbars="none"
			android:visibility="gone"
			app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintStart_toStartOf="parent"
			app:layout_constraintTop_toBottomOf="@id/textView_scrobbling_title"
			tools:itemCount="2"
			tools:listitem="@layout/item_scrobbling_info"
			tools:visibility="visible" />

		<com.google.android.material.progressindicator.LinearProgressIndicator
			android:id="@+id/progressBar"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:indeterminate="true"
			android:visibility="gone"
			app:hideAnimationBehavior="outward"
			app:layout_constraintBottom_toTopOf="parent"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintStart_toStartOf="parent"
			app:layout_constraintTop_toTopOf="parent"
			app:showAnimationBehavior="inward"
			app:trackCornerRadius="0dp"
			tools:visibility="visible" />

		<androidx.constraintlayout.widget.Group
			android:id="@+id/group_bookmarks"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:visibility="gone"
			app:constraint_referenced_ids="recyclerView_bookmarks,textView_bookmarks_title,button_bookmarks_more"
			tools:visibility="visible" />

		<androidx.constraintlayout.widget.Group
			android:id="@+id/group_scrobbling"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:visibility="gone"
			app:constraint_referenced_ids="recyclerView_scrobbling,textView_scrobbling_title,button_scrobbling_more"
			tools:visibility="visible" />

		<TextView
			android:id="@+id/textView_related_title"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:layout_marginStart="@dimen/margin_small"
			android:layout_marginTop="@dimen/margin_small"
			android:layout_weight="1"
			android:gravity="center_vertical|start"
			android:padding="@dimen/grid_spacing"
			android:singleLine="true"
			android:text="@string/related_manga"
			android:textAppearance="@style/TextAppearance.Kotatsu.SectionHeader"
			app:layout_constraintEnd_toStartOf="@id/button_related_more"
			app:layout_constraintStart_toStartOf="parent"
			app:layout_constraintTop_toBottomOf="@id/recyclerView_scrobbling" />

		<Button
			android:id="@+id/button_related_more"
			style="@style/Widget.Kotatsu.Button.More"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_marginEnd="8dp"
			android:text="@string/show_all"
			android:visibility="gone"
			app:layout_constraintBaseline_toBaselineOf="@id/textView_related_title"
			app:layout_constraintEnd_toEndOf="parent" />

		<androidx.recyclerview.widget.RecyclerView
			android:id="@+id/recyclerView_related"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:layout_marginBottom="6dp"
			android:clipToPadding="false"
			android:nestedScrollingEnabled="false"
			android:orientation="horizontal"
			android:paddingStart="12dp"
			android:paddingEnd="12dp"
			app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintStart_toStartOf="parent"
			app:layout_constraintTop_toBottomOf="@id/textView_related_title"
			tools:listitem="@layout/item_manga_grid" />

		<androidx.constraintlayout.widget.Group
			android:id="@+id/group_related"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:visibility="gone"
			app:constraint_referenced_ids="recyclerView_related,textView_related_title,button_related_more"
			tools:visibility="visible" />

	</androidx.constraintlayout.widget.ConstraintLayout>

</androidx.core.widget.NestedScrollView>
