<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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="match_parent">

    <include
        android:id="@+id/error_layout"
        layout="@layout/error_panel" />

    <ScrollView
        android:id="@+id/fragment_content"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="24dp"
                android:layout_marginBottom="24dp">

                <com.google.android.material.imageview.ShapeableImageView
                    android:id="@+id/person_image"
                    android:layout_width="220dp"
                    android:layout_height="345dp"
                    android:scaleType="centerCrop"
                    app:layout_constraintDimensionRatio="H,3:2"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Findroid.Image" />

                <TextView
                    android:id="@+id/name"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginHorizontal="24dp"
                    android:layout_marginTop="16dp"
                    android:gravity="center"
                    android:textAppearance="@style/TextAppearance.Material3.HeadlineMedium"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/person_image"
                    tools:text="Actor/Actress name" />

                <TextView
                    android:id="@+id/overview"
                    android:layout_width="0dp"
                    android:layout_height="@dimen/person_detail_overview_height"
                    android:layout_marginHorizontal="24dp"
                    android:layout_marginTop="16dp"
                    android:ellipsize="end"
                    android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
                    app:layout_constraintBottom_toTopOf="@id/read_all"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/name" />

                <FrameLayout
                    android:id="@+id/overview_gradient"
                    android:layout_width="0dp"
                    android:layout_height="24dp"
                    android:background="@drawable/header_gradient"
                    app:layout_constraintBottom_toBottomOf="@id/overview"
                    app:layout_constraintEnd_toEndOf="@id/overview"
                    app:layout_constraintStart_toStartOf="@id/overview" />

                <Button
                    android:id="@+id/read_all"
                    style="@style/Widget.Material3.Button.TextButton"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="24dp"
                    android:text="@string/view_all"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent" />


            </androidx.constraintlayout.widget.ConstraintLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="24dp"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/movie_label"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginHorizontal="24dp"
                    android:layout_marginBottom="12dp"
                    android:text="@string/movies_label"
                    android:textAppearance="@style/TextAppearance.Material3.TitleMedium"
                    android:visibility="gone" />

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/movies_list"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="24dp"
                    android:clipToPadding="false"
                    android:orientation="horizontal"
                    android:paddingHorizontal="12dp"
                    app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                    tools:itemCount="4"
                    tools:listitem="@layout/base_item" />

                <TextView
                    android:id="@+id/show_label"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginHorizontal="24dp"
                    android:layout_marginBottom="12dp"
                    android:text="@string/shows_label"
                    android:textAppearance="@style/TextAppearance.Material3.TitleMedium"
                    android:visibility="gone" />

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/show_list"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:clipToPadding="false"
                    android:orientation="horizontal"
                    android:paddingHorizontal="12dp"
                    app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                    tools:itemCount="4"
                    tools:listitem="@layout/base_item" />

            </LinearLayout>

        </LinearLayout>

    </ScrollView>

    <com.google.android.material.progressindicator.LinearProgressIndicator
        android:id="@+id/loading_indicator"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:indeterminate="true"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>