<?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:focusable="true"
    android:focusableInTouchMode="true"
    android:clipChildren="false"
    android:clipToPadding="false"
    android:layout_width="@dimen/poster_width_landscape"
    android:layout_height="@dimen/poster_height_landscape"
    android:layout_marginEnd="24dp">
    <androidx.cardview.widget.CardView
        android:id="@+id/poster_card"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:stateListAnimator="@null"
        app:cardBackgroundColor="@android:color/black"
        app:cardCornerRadius="@dimen/radius_poster"
        app:cardElevation="0dp"
        app:cardUseCompatPadding="false">
        <ImageView
            android:id="@+id/poster_image"
            android:background="@drawable/poster_card_background"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scaleType="centerCrop"
            android:contentDescription="@null"
            android:clipToOutline="true"/>
        <ImageView
            android:id="@+id/expanded_backdrop"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scaleType="centerCrop"
            android:contentDescription="@null"
            android:alpha="0"/>
        <View
            android:id="@+id/expanded_scrim"
            android:background="@drawable/bg_trailer_loading_scrim"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>
        <ImageView
            android:layout_gravity="center"
            android:id="@+id/expanded_logo"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="64dp"
            android:scaleType="fitCenter"
            android:contentDescription="@null"
            android:alpha="0"
            android:layout_marginStart="12dp"
            android:layout_marginEnd="12dp"/>
        <FrameLayout
            android:layout_gravity="center"
            android:id="@+id/logo_container"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <View
                android:background="@drawable/backdrop_logo_gradient"
                android:layout_width="match_parent"
                android:layout_height="match_parent"/>
            <ImageView
                android:layout_gravity="start|bottom"
                android:id="@+id/logo_overlay"
                android:visibility="gone"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="12dp"
                android:scaleType="fitCenter"
                android:adjustViewBounds="true"
                android:maxWidth="108dp"
                android:maxHeight="40dp"
                android:contentDescription="@null"
                android:layout_marginStart="12dp"/>
            <TextView
                android:textSize="14sp"
                android:textColor="@android:color/white"
                android:ellipsize="end"
                android:gravity="start"
                android:layout_gravity="start|bottom"
                android:id="@+id/logo_title_fallback"
                android:visibility="gone"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="12dp"
                android:maxLines="2"
                android:shadowColor="#000000"
                android:shadowDx="0"
                android:shadowDy="2"
                android:shadowRadius="4"
                android:fontFamily="sans-serif-medium"
                android:layout_marginStart="12dp"
                android:layout_marginEnd="48dp"/>
        </FrameLayout>
        <TextView
            android:textSize="@dimen/text_hero_metadata"
            android:textColor="@android:color/white"
            android:ellipsize="end"
            android:layout_gravity="bottom"
            android:id="@+id/poster_title_overlay"
            android:background="@drawable/poster_title_bg"
            android:paddingTop="8dp"
            android:paddingBottom="10dp"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:maxLines="1"
            android:paddingStart="12dp"
            android:paddingEnd="12dp"/>
        <View
            android:layout_gravity="bottom"
            android:id="@+id/progress_bar"
            android:background="@drawable/progress_bar_round_red"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="4dp"/>
    </androidx.cardview.widget.CardView>
    <View
        android:id="@+id/focus_overlay"
        android:background="@drawable/poster_focus_glow"
        android:visibility="invisible"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
    <ImageView
        android:layout_gravity="end|top"
        android:id="@+id/watched_badge"
        android:visibility="gone"
        android:layout_width="28dp"
        android:layout_height="28dp"
        android:layout_marginTop="8dp"
        android:src="@drawable/ic_check_badge"
        android:contentDescription="@null"
        android:layout_marginEnd="8dp"/>
    <TextView
        android:textSize="9sp"
        android:textColor="@android:color/white"
        android:layout_gravity="start|top"
        android:id="@+id/episode_indicator_badge"
        android:background="@drawable/bg_episode_indicator"
        android:visibility="gone"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:fontFamily="sans-serif-medium"
        android:layout_marginStart="8dp"
        android:elevation="8dp"
        android:letterSpacing="0.05"
        android:paddingHorizontal="6dp"
        android:paddingVertical="2dp"/>
    <TextView
        android:textSize="10sp"
        android:textColor="@android:color/white"
        android:gravity="center"
        android:layout_gravity="end|top"
        android:id="@+id/unwatched_count_badge"
        android:background="@drawable/bg_unwatched_count"
        android:visibility="gone"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:minWidth="24dp"
        android:fontFamily="sans-serif-medium"
        android:layout_marginEnd="8dp"
        android:elevation="8dp"
        android:paddingHorizontal="5dp"
        android:paddingVertical="2dp"/>
</FrameLayout>
