<?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/media_info_scrollview"
        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"
            tools:context=".fragments.ShowFragment">

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="200dp"
                android:layout_marginBottom="8dp">

                <ImageView
                    android:id="@+id/item_banner"
                    android:layout_width="match_parent"
                    android:layout_height="200dp"
                    android:scaleType="centerCrop"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    tools:ignore="ContentDescription" />

                <FrameLayout
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:background="@drawable/header_gradient"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

                <TextView
                    android:id="@+id/name"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginHorizontal="24dp"
                    android:textAppearance="@style/TextAppearance.Material3.HeadlineMedium"
                    app:layout_constraintBottom_toTopOf="@id/original_title"
                    app:layout_constraintStart_toStartOf="parent"
                    tools:text="Alita: Battle Angel" />

                <TextView
                    android:id="@+id/original_title"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginHorizontal="24dp"
                    android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintStart_toStartOf="parent" />
            </androidx.constraintlayout.widget.ConstraintLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="24dp">

                <TextView
                    android:id="@+id/year"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="8dp"
                    android:gravity="center"
                    android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
                    tools:text="2019" />

                <TextView
                    android:id="@+id/playtime"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="8dp"
                    android:gravity="center"
                    android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
                    tools:text="122 min" />

                <TextView
                    android:id="@+id/official_rating"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="8dp"
                    android:gravity="center"
                    android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
                    tools:text="PG-13" />

                <TextView
                    android:id="@+id/community_rating"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="8dp"
                    android:drawablePadding="4dp"
                    android:gravity="center"
                    android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
                    app:drawableStartCompat="@drawable/ic_star"
                    app:drawableTint="@color/yellow"
                    tools:text="7.3" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginVertical="15dp"
                android:baselineAligned="false"
                android:orientation="horizontal">

                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:orientation="vertical">

                    <include
                        android:id="@+id/item_actions"
                        layout="@layout/item_actions"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginHorizontal="20dp" />

                    <LinearLayout
                        android:id="@+id/player_items_error"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginHorizontal="24dp"
                        android:orientation="vertical"
                        android:visibility="gone"
                        tools:visibility="visible">

                        <TextView
                            android:id="@+id/player_items_error_text"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginEnd="8dp"
                            android:text="@string/error_preparing_player_items"
                            android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
                            android:textColor="?attr/colorError" />

                        <TextView
                            android:id="@+id/player_items_error_details"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/view_details_underlined"
                            android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
                            android:textColor="?attr/colorError" />
                    </LinearLayout>

                    <include
                        android:id="@+id/info"
                        layout="@layout/item_info" />

                </LinearLayout>

                <LinearLayout
                    android:id="@+id/next_up_layout"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="24dp"
                    android:layout_weight="1"
                    android:orientation="vertical"
                    android:visibility="gone"
                    tools:visibility="visible">

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginHorizontal="24dp"
                        android:layout_marginBottom="12dp"
                        android:text="@string/next_up"
                        android:textAppearance="@style/TextAppearance.Material3.TitleMedium"
                        android:textSize="18sp" />

                    <androidx.constraintlayout.widget.ConstraintLayout
                        android:id="@+id/next_up"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginHorizontal="24dp"
                        android:clickable="true"
                        android:focusable="true"
                        android:foreground="@drawable/ripple_background"
                        android:orientation="vertical">

                        <com.google.android.material.imageview.ShapeableImageView
                            android:id="@+id/next_up_image"
                            android:layout_width="0dp"
                            android:layout_height="0dp"
                            android:adjustViewBounds="true"
                            app:layout_constraintDimensionRatio="H,16:9"
                            app:layout_constraintEnd_toEndOf="parent"
                            app:layout_constraintStart_toStartOf="parent"
                            app:layout_constraintTop_toTopOf="parent"
                            app:shapeAppearance="@style/ShapeAppearanceOverlay.Findroid.Image" />

                        <TextView
                            android:id="@+id/next_up_name"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="4dp"
                            android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
                            app:layout_constraintEnd_toEndOf="parent"
                            app:layout_constraintStart_toStartOf="parent"
                            app:layout_constraintTop_toBottomOf="@id/next_up_image"
                            tools:text="The Girl Flautist" />
                    </androidx.constraintlayout.widget.ConstraintLayout>

                </LinearLayout>

            </LinearLayout>

            <LinearLayout
                android:id="@+id/seasons_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="24dp"
                android:orientation="vertical">

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginHorizontal="24dp"
                    android:layout_marginBottom="12dp"
                    android:text="@string/seasons"
                    android:textAppearance="@style/TextAppearance.Material3.TitleMedium"
                    android:textSize="18sp" />

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/seasons_recycler_view"
                    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="3"
                    tools:listitem="@layout/base_item" />

            </LinearLayout>

            <LinearLayout
                android:id="@+id/actors"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="16dp"
                android:orientation="vertical">

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginHorizontal="24dp"
                    android:layout_marginBottom="12dp"
                    android:text="@string/cast_amp_crew"
                    android:textAppearance="@style/TextAppearance.Material3.TitleMedium"
                    android:textSize="18sp" />

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/people_recycler_view"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:clipToPadding="false"
                    android:orientation="horizontal"
                    android:paddingHorizontal="16dp"
                    app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                    tools:itemCount="3"
                    tools:listitem="@layout/person_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.Guideline
        android:id="@+id/guideline2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        app:layout_constraintGuide_begin="20dp" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/guideline3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        app:layout_constraintGuide_begin="20dp" />

</androidx.constraintlayout.widget.ConstraintLayout>
