<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"
    android:background="@android:color/black"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <ImageView
        android:id="@+id/hero_backdrop"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="centerCrop"/>
    <ImageView
        android:id="@+id/hero_backdrop_incoming"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="centerCrop"
        android:alpha="0"/>
    <View
        android:id="@+id/ambient_background_overlay"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
    <View
        android:id="@+id/sidecar_scrim"
        android:background="@drawable/sidecar_scrim_gradient"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
    <com.strmr.ps.ui.widget.FadingImageView
        android:id="@+id/hero_sidecar"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="centerCrop"
        android:alpha="0"/>
    <View
        android:background="@drawable/fullscreen_gradient"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
    <View
        android:id="@+id/background_dim_overlay"
        android:background="@android:color/black"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:alpha="0"/>
    <ImageView
        android:layout_gravity="end|top"
        android:id="@+id/actor_portrait"
        android:visibility="gone"
        android:layout_width="120dp"
        android:layout_height="180dp"
        android:layout_marginTop="24dp"
        android:scaleType="centerCrop"
        android:contentDescription="@string/hero_logo_content_description"
        android:layout_marginEnd="48dp"
        android:elevation="4dp"/>
    <LinearLayout
        android:orientation="vertical"
        android:id="@+id/actor_content_container"
        android:clipChildren="false"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="6dp"
        android:layout_marginBottom="0dp"
        android:weightSum="2"
        android:layout_marginStart="0dp">
        <LinearLayout
            android:gravity="top"
            android:orientation="vertical"
            android:id="@+id/hero_info_container"
            android:paddingBottom="@dimen/hero_container_padding_bottom"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="0.8"
            android:paddingStart="@dimen/hero_container_padding_start"
            android:paddingEnd="@dimen/hero_container_padding_end"
            android:layout_marginStart="0dp">
            <ImageView
                android:id="@+id/hero_logo"
                android:visibility="gone"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/hero_logo_margin_top"
                android:layout_marginBottom="@dimen/hero_logo_margin_bottom"
                android:scaleType="fitCenter"
                android:adjustViewBounds="true"
                android:maxWidth="@dimen/hero_logo_max_width"
                android:maxHeight="@dimen/hero_logo_max_height"
                android:contentDescription="@string/hero_logo_content_description"/>
            <TextView
                android:textSize="@dimen/hero_title_size"
                android:textStyle="bold"
                android:textColor="@android:color/white"
                android:ellipsize="end"
                android:id="@+id/hero_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/hero_title_margin_top"
                android:maxLines="1"
                android:shadowColor="#cc000000"
                android:shadowDx="0"
                android:shadowDy="4"
                android:shadowRadius="12"/>
            <TextView
                android:textSize="@dimen/hero_metadata_size"
                android:textStyle="bold"
                android:textColor="#f0ffffff"
                android:id="@+id/hero_metadata"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/hero_metadata_margin_top"
                android:shadowColor="#cc000000"
                android:shadowDx="0"
                android:shadowDy="4"
                android:shadowRadius="12"/>
            <TextView
                android:textSize="@dimen/hero_genre_size"
                android:textColor="@android:color/white"
                android:ellipsize="end"
                android:id="@+id/hero_genre_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/hero_genre_margin_top"
                android:maxLines="1"
                android:shadowColor="#cc000000"
                android:shadowDx="0"
                android:shadowDy="4"
                android:shadowRadius="12"/>
            <com.strmr.ps.ui.widget.AutoScrollTextView
                android:textSize="@dimen/hero_overview_size"
                android:textColor="@android:color/white"
                android:id="@+id/hero_overview"
                android:layout_width="match_parent"
                android:layout_height="@dimen/hero_overview_height"
                android:layout_marginTop="@dimen/hero_overview_margin_top"
                android:shadowColor="#cc000000"
                android:shadowDx="0"
                android:shadowDy="4"
                android:shadowRadius="12"
                android:lineSpacingMultiplier="1.1"
                android:layout_marginEnd="@dimen/hero_overview_margin_end"/>
            <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/hero_cast_margin_top">
                <TextView
                    android:textSize="@dimen/hero_cast_size"
                    android:textColor="#cccccc"
                    android:ellipsize="end"
                    android:id="@+id/hero_cast"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:maxLines="1"
                    android:shadowColor="#cc000000"
                    android:shadowDx="0"
                    android:shadowDy="4"
                    android:shadowRadius="12"/>
            </FrameLayout>
        </LinearLayout>
        <com.google.android.material.button.MaterialButton
            android:textSize="14sp"
            android:id="@+id/biography_button"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:visibility="gone"
            android:nextFocusDown="@+id/content_rows"
            android:layout_width="wrap_content"
            android:layout_height="40dp"
            android:layout_marginTop="4dp"
            android:layout_marginBottom="4dp"
            android:text="@string/label_biography"
            android:layout_marginStart="@dimen/hero_container_padding_start"
            app:icon="@drawable/ic_chevron_right_small"
            app:iconGravity="end"
            app:iconSize="16dp"
            style="@style/Widget.Strmr.Button.Outlined"/>
        <androidx.leanback.widget.VerticalGridView
            android:id="@+id/content_rows"
            android:paddingTop="8dp"
            android:paddingBottom="12dp"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:nextFocusUp="@+id/biography_button"
            android:clipChildren="true"
            android:clipToPadding="true"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1.2"
            android:paddingStart="0dp"/>
    </LinearLayout>
    <ProgressBar
        android:layout_gravity="center"
        android:id="@+id/loading_indicator"
        android:visibility="gone"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>
</FrameLayout>
