<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/black"
    android:gravity="center"
    tools:layout_height="84dp"
    tools:layout_width="@dimen/popup_minimum_width">

    <com.google.android.exoplayer2.ui.AspectRatioFrameLayout
        android:id="@+id/aspectRatioLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center">

        <SurfaceView
            android:id="@+id/surfaceView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_gravity="center"/>

        <View
            android:id="@+id/surfaceForeground"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@android:color/black"/>

        <com.google.android.exoplayer2.ui.SubtitleView
            android:id="@+id/subtitleView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>
    </com.google.android.exoplayer2.ui.AspectRatioFrameLayout>


    <ImageView
        android:id="@+id/endScreen"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/black"
        android:visibility="gone"
        tools:background="@android:color/white"
        tools:ignore="ContentDescription"
        tools:visibility="visible"/>

    <RelativeLayout
        android:id="@+id/playbackControlRoot"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#32000000"
        android:visibility="gone"
        tools:visibility="visible">

        <ImageView
        android:id="@+id/videoPlayPause"
        android:layout_width="55dp"
        android:layout_height="55dp"
        android:layout_centerHorizontal="false"
        android:layout_centerInParent="true"
        android:visibility="gone"
        tools:ignore="ContentDescription"
        tools:visibility="visible" />

        <RelativeLayout
            android:id="@+id/topControls"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:background="@drawable/player_top_controls_bg"
            android:paddingBottom="20dp"
            android:paddingLeft="2dp"
            android:paddingRight="6dp"
            android:paddingTop="4dp"
            tools:ignore="RtlHardcoded">

            <TextView
                android:id="@+id/qualityTextView"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_alignParentLeft="true"
                android:gravity="center"
                android:padding="5dp"
                android:textColor="@android:color/white"
                android:textStyle="bold"
                android:background="?attr/selectableItemBackground"
                tools:ignore="RtlHardcoded,RtlSymmetry"
                tools:text="1080p60"/>

            <TextView
                android:id="@+id/playbackSpeed"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_toRightOf="@+id/qualityTextView"
                android:gravity="center"
                android:padding="5dp"
                android:textColor="@android:color/white"
                android:textStyle="bold"
                android:background="?attr/selectableItemBackground"
                tools:ignore="RelativeOverlap,RtlHardcoded,RtlSymmetry"
                tools:text="1.75x"/>

            <RelativeLayout
                android:id="@+id/extraOptionsView"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_toRightOf="@+id/playbackSpeed"
                android:layout_toLeftOf="@id/fullScreenButton"
                android:visibility="gone">

                <TextView
                    android:id="@+id/resizeTextView"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:layout_alignParentLeft="true"
                    android:background="?attr/selectableItemBackground"
                    android:gravity="center"
                    android:minWidth="50dp"
                    android:padding="5dp"
                    android:textColor="@android:color/white"
                    android:textStyle="bold"
                    tools:ignore="HardcodedText,RtlHardcoded"
                    tools:text="FIT" />

                <TextView
                    android:id="@+id/captionTextView"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:padding="5dp"
                    android:layout_toRightOf="@id/resizeTextView"
                    android:gravity="center|left"
                    android:minWidth="40dp"
                    android:textColor="@android:color/white"
                    android:textStyle="bold"
                    android:background="?attr/selectableItemBackground"
                    tools:ignore="RelativeOverlap,RtlHardcoded,RtlSymmetry"
                    tools:text="English" />
            </RelativeLayout>

            <ImageButton
                android:id="@+id/fullScreenButton"
                android:layout_width="30dp"
                android:layout_height="30dp"
                android:layout_alignParentRight="true"
                android:background="?attr/selectableItemBackground"
                android:clickable="true"
                android:focusable="true"
                android:scaleType="fitCenter"
                android:src="@drawable/ic_fullscreen_white"
                tools:ignore="ContentDescription,RtlHardcoded" />

        </RelativeLayout>

        <!--Shadow Bottom Control-->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:background="@drawable/player_controls_bg"
            android:orientation="horizontal"
            android:paddingTop="50dp"/>

        <LinearLayout
            android:id="@+id/bottomControls"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            android:paddingBottom="2dp"
            android:paddingLeft="8dp"
            android:paddingRight="8dp">

            <TextView
                android:id="@+id/playbackCurrentTime"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="center_vertical"
                android:text="-:--:--"
                android:textColor="@android:color/white"
                tools:ignore="HardcodedText,RtlHardcoded,RtlSymmetry"
                tools:text="1:06:29"/>

            <androidx.appcompat.widget.AppCompatSeekBar
                android:id="@+id/playbackSeekBar"
                style="@style/Widget.AppCompat.SeekBar"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_weight="1"
                tools:progress="25"
                tools:secondaryProgress="50"/>

            <TextView
                android:id="@+id/playbackEndTime"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="center_vertical"
                android:text="-:--:--"
                android:textColor="@android:color/white"
                tools:ignore="HardcodedText,RtlHardcoded,RtlSymmetry"
                tools:text="1:23:49"/>

            <TextView
                android:id="@+id/playbackLiveSync"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:paddingLeft="4dp"
                android:paddingRight="4dp"
                android:gravity="center_vertical"
                android:text="@string/duration_live"
                android:textAllCaps="true"
                android:textColor="@android:color/white"
                android:visibility="gone"
                android:background="?attr/selectableItemBackground"
                tools:ignore="HardcodedText,RtlHardcoded,RtlSymmetry" />
        </LinearLayout>
    </RelativeLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:orientation="horizontal"
        android:weightSum="5.5">
        <!--tools:visibility="gone">-->

        <ImageView
            android:id="@+id/controlAnimationView"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:src="@drawable/ic_action_av_fast_rewind"
            android:visibility="gone"
            tools:ignore="ContentDescription"
            tools:visibility="visible"/>
    </LinearLayout>

    <TextView
        android:id="@+id/currentDisplaySeek"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:background="#64000000"
        android:paddingBottom="5dp"
        android:paddingLeft="20dp"
        android:paddingRight="20dp"
        android:paddingTop="5dp"
        android:textColor="@android:color/white"
        android:textSize="18sp"
        android:textStyle="bold"
        android:visibility="gone"
        tools:ignore="RtlHardcoded"
        tools:text="1:06:29"
        tools:visibility="visible"/>

    <RelativeLayout
        android:id="@+id/loading_panel"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center"
        android:background="@color/black"
        android:gravity="center"
        android:padding="20dp"
        tools:visibility="gone">

        <ProgressBar
            android:id="@+id/progressBarLoadingPanel"
            style="?android:attr/progressBarStyleLarge"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:indeterminate="true"/>
    </RelativeLayout>


    <TextView
        android:id="@+id/resizing_indicator"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="left|top"
        android:background="#6e000000"
        android:gravity="center"
        android:padding="5dp"
        android:text="@string/popup_resizing_indicator_title"
        android:textColor="@android:color/white"
        android:textSize="18sp"
        android:textStyle="bold"
        android:visibility="gone"
        tools:ignore="RtlHardcoded"
        tools:visibility="gone"/>

    <View
        android:id="@+id/closingOverlay"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#AAFF0000"
        android:visibility="gone"/>
</FrameLayout>