<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
    android:background="@color/black"
    android:gravity="center"
    android:theme="@style/WhiteTintTheme">

    <org.schabi.newpipe.views.ExpandableSurfaceView
        android:id="@+id/surfaceView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_centerInParent="true" />

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

    <TextView
        android:id="@+id/pinchZoomIndicator"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="48dp"
        android:background="@drawable/background_rectangle_black_transparent"
        android:paddingHorizontal="6dp"
        android:paddingVertical="3dp"
        android:textColor="@android:color/white"
        android:textSize="11sp"
        android:visibility="gone"
        tools:text="1.5×"
        tools:visibility="visible" />

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

    <View
        android:id="@+id/playerTopShadow"
        android:layout_width="match_parent"
        android:layout_height="30dp"
        android:layout_alignParentTop="true"
        android:background="@drawable/player_controls_top_background"
        android:visibility="gone" />

    <View
        android:id="@+id/playerBottomShadow"
        android:layout_width="match_parent"
        android:layout_height="30dp"
        android:layout_alignParentBottom="true"
        android:background="@drawable/player_controls_background"
        android:visibility="gone" />

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

    <View
        android:id="@+id/playbackControlsShadow"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignBottom="@+id/playbackControlRoot"
        android:background="@color/video_overlay_color"
        android:visibility="gone"
        tools:visibility="visible" />

    <!-- transparent background is needed for selectableItemBackgroundBorderless to work -->
    <RelativeLayout
        android:id="@+id/playbackControlRoot"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/transparent_background_color"
        android:fitsSystemWindows="true"
        android:visibility="gone"
        tools:visibility="visible">

        <!-- All top controls in this layout -->
        <RelativeLayout
            android:id="@+id/playbackWindowRoot"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <LinearLayout
                android:id="@+id/topControls"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:baselineAligned="false"
                android:descendantFocusability="afterDescendants"
                android:gravity="top"
                android:orientation="vertical"
                android:paddingStart="@dimen/player_main_controls_padding"
                android:paddingTop="@dimen/player_main_top_padding"
                android:paddingEnd="@dimen/player_main_controls_padding">

                <LinearLayout
                    android:id="@+id/primaryControls"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:baselineAligned="false"
                    android:descendantFocusability="afterDescendants"
                    android:gravity="top"
                    android:minHeight="45dp"
                    tools:ignore="RtlHardcoded">

                    <androidx.appcompat.widget.AppCompatImageButton
                        android:id="@+id/playerCloseButton"
                        android:layout_width="36dp"
                        android:layout_height="36dp"
                        android:layout_marginEnd="8dp"
                        android:background="?attr/selectableItemBackgroundBorderless"
                        android:clickable="true"
                        android:focusable="true"
                        android:padding="@dimen/player_main_buttons_padding"
                        android:scaleType="fitXY"
                        android:visibility="gone"
                        app:srcCompat="@drawable/ic_close"
                        app:tint="@color/white"
                        tools:ignore="ContentDescription,RtlHardcoded" />

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="match_parent"
                        android:layout_weight="1"
                        android:orientation="horizontal">

                        <LinearLayout
                            android:id="@+id/metadataView"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="6dp"
                            android:layout_marginEnd="8dp"
                            android:layout_weight="1"
                            android:gravity="top"
                            android:orientation="vertical"
                            tools:ignore="NestedWeights,RtlHardcoded">

                            <org.schabi.newpipe.views.NewPipeTextView
                                android:id="@+id/titleTextView"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:ellipsize="marquee"
                                android:fadingEdge="horizontal"
                                android:marqueeRepeatLimit="marquee_forever"
                                android:scrollHorizontally="true"
                                android:singleLine="true"
                                android:textColor="@android:color/white"
                                android:textSize="15sp"
                                android:textStyle="bold"
                                tools:ignore="RtlHardcoded"
                                tools:text="The Video Title LONG very LONG" />

                            <org.schabi.newpipe.views.NewPipeTextView
                                android:id="@+id/channelTextView"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:ellipsize="marquee"
                                android:fadingEdge="horizontal"
                                android:marqueeRepeatLimit="marquee_forever"
                                android:scrollHorizontally="true"
                                android:singleLine="true"
                                android:textColor="@android:color/white"
                                android:textSize="12sp"
                                tools:text="The Video Artist  LONG very LONG very Long" />

                        </LinearLayout>

                        <FrameLayout
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_weight="1">

                            <org.schabi.newpipe.views.NewPipeTextView
                                android:id="@+id/audioTrackTextView"
                                android:layout_width="wrap_content"
                                android:layout_height="35dp"
                                android:layout_gravity="right"
                                android:layout_marginEnd="8dp"
                                android:background="?attr/selectableItemBackground"
                                android:ellipsize="end"
                                android:gravity="center"
                                android:minWidth="0dp"
                                android:padding="@dimen/player_main_buttons_padding"
                                android:singleLine="true"
                                android:textColor="@android:color/white"
                                android:textStyle="bold"
                                android:visibility="gone"
                                tools:ignore="HardcodedText,RtlHardcoded"
                                tools:text="English (United States) original"
                                tools:visibility="visible" />
                        </FrameLayout>

                    </LinearLayout>

                    <org.schabi.newpipe.views.NewPipeTextView
                        android:id="@+id/qualityTextView"
                        android:layout_width="wrap_content"
                        android:layout_height="35dp"
                        android:layout_marginEnd="8dp"
                        android:background="?attr/selectableItemBackground"
                        android:gravity="center"
                        android:minWidth="0dp"
                        android:padding="@dimen/player_main_buttons_padding"
                        android:textColor="@android:color/white"
                        android:textStyle="bold"
                        tools:ignore="HardcodedText,RtlHardcoded"
                        tools:text="720p" />

                    <org.schabi.newpipe.views.NewPipeTextView
                        android:id="@+id/playbackSpeed"
                        android:layout_width="wrap_content"
                        android:layout_height="35dp"
                        android:layout_marginEnd="8dp"
                        android:background="?attr/selectableItemBackgroundBorderless"
                        android:gravity="center"
                        android:minWidth="0dp"
                        android:padding="@dimen/player_main_buttons_padding"
                        android:textColor="@android:color/white"
                        android:textStyle="bold"
                        tools:ignore="RtlHardcoded,RtlSymmetry"
                        tools:text="1x" />

                    <androidx.appcompat.widget.AppCompatImageButton
                        android:id="@+id/queueButton"
                        android:layout_width="35dp"
                        android:layout_height="35dp"
                        android:layout_marginEnd="8dp"
                        android:background="?attr/selectableItemBackgroundBorderless"
                        android:clickable="true"
                        android:focusable="true"
                        android:paddingStart="3dp"
                        android:paddingTop="5dp"
                        android:paddingEnd="3dp"
                        android:paddingBottom="3dp"
                        android:scaleType="fitCenter"
                        android:visibility="gone"
                        app:srcCompat="@drawable/ic_list"
                        app:tint="@color/white"
                        tools:ignore="ContentDescription,RtlHardcoded" />

                    <androidx.appcompat.widget.AppCompatImageButton
                        android:id="@+id/segmentsButton"
                        android:layout_width="35dp"
                        android:layout_height="35dp"
                        android:layout_marginEnd="8dp"
                        android:background="?attr/selectableItemBackgroundBorderless"
                        android:clickable="true"
                        android:focusable="true"
                        android:paddingStart="6dp"
                        android:paddingTop="5dp"
                        android:paddingEnd="6dp"
                        android:paddingBottom="3dp"
                        android:scaleType="fitCenter"
                        android:visibility="gone"
                        app:srcCompat="@drawable/ic_format_list_numbered"
                        app:tint="@color/white"
                        tools:ignore="ContentDescription,RtlHardcoded" />

                    <androidx.appcompat.widget.AppCompatImageButton
                        android:id="@+id/moreOptionsButton"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:background="?attr/selectableItemBackgroundBorderless"
                        android:clickable="true"
                        android:focusable="true"
                        android:padding="@dimen/player_main_buttons_padding"
                        android:scaleType="fitXY"
                        app:srcCompat="@drawable/ic_expand_more"
                        app:tint="@color/white"
                        tools:ignore="ContentDescription,RtlHardcoded" />

                </LinearLayout>

                <LinearLayout
                    android:id="@+id/secondaryControls"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="top"
                    android:visibility="invisible"
                    tools:ignore="RtlHardcoded"
                    tools:visibility="visible">

                    <org.schabi.newpipe.views.NewPipeTextView
                        android:id="@+id/resizeTextView"
                        android:layout_width="wrap_content"
                        android:layout_height="35dp"
                        android:layout_marginEnd="8dp"
                        android:background="?attr/selectableItemBackground"
                        android:gravity="center"
                        android:minWidth="50dp"
                        android:padding="@dimen/player_main_buttons_padding"
                        android:textColor="@android:color/white"
                        android:textStyle="bold"
                        tools:ignore="HardcodedText,RtlHardcoded"
                        tools:text="FIT" />

                    <FrameLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="3">

                        <org.schabi.newpipe.views.NewPipeTextView
                            android:id="@+id/captionTextView"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginEnd="8dp"
                            android:background="?attr/selectableItemBackground"
                            android:ellipsize="end"
                            android:gravity="center|left"
                            android:lines="1"
                            android:minWidth="50dp"
                            android:minHeight="35dp"
                            android:padding="@dimen/player_main_buttons_padding"
                            android:textColor="@android:color/white"
                            android:textStyle="bold"
                            tools:ignore="RelativeOverlap,RtlHardcoded"
                            tools:text="English" />

                    </FrameLayout>

                    <androidx.appcompat.widget.AppCompatImageButton
                        android:id="@+id/switchCommentsVisibility"
                        android:layout_width="wrap_content"
                        android:layout_height="35dp"
                        android:layout_marginEnd="8dp"
                        android:background="?attr/selectableItemBackgroundBorderless"
                        android:clickable="true"
                        android:contentDescription="Switch comment visibility"
                        android:focusable="true"
                        android:padding="@dimen/player_main_buttons_padding"
                        android:scaleType="fitXY"
                        app:srcCompat="@drawable/ic_bullet_comment_enabled"
                        app:tint="@color/white"
                        tools:ignore="RtlHardcoded" />

                    <androidx.appcompat.widget.AppCompatImageButton
                        android:id="@+id/playWithKodi"
                        android:layout_width="wrap_content"
                        android:layout_height="35dp"
                        android:layout_marginEnd="8dp"
                        android:background="?attr/selectableItemBackgroundBorderless"
                        android:clickable="true"
                        android:contentDescription="@string/play_with_kodi_title"
                        android:focusable="true"
                        android:padding="@dimen/player_main_buttons_padding"
                        android:scaleType="fitXY"
                        app:srcCompat="@drawable/ic_cast"
                        app:tint="@color/white"
                        tools:ignore="RtlHardcoded" />

                    <androidx.appcompat.widget.AppCompatImageButton
                        android:id="@+id/openInBrowser"
                        android:layout_width="wrap_content"
                        android:layout_height="35dp"
                        android:layout_marginEnd="8dp"
                        android:background="?attr/selectableItemBackgroundBorderless"
                        android:clickable="true"
                        android:contentDescription="@string/open_in_browser"
                        android:focusable="true"
                        android:padding="@dimen/player_main_buttons_padding"
                        android:scaleType="fitXY"
                        app:srcCompat="@drawable/ic_language"
                        app:tint="@color/white"
                        tools:ignore="RtlHardcoded" />

                    <androidx.appcompat.widget.AppCompatImageButton
                        android:id="@+id/share"
                        android:layout_width="wrap_content"
                        android:layout_height="35dp"
                        android:layout_marginEnd="8dp"
                        android:background="?attr/selectableItemBackgroundBorderless"
                        android:clickable="true"
                        android:contentDescription="@string/share"
                        android:focusable="true"
                        android:padding="@dimen/player_main_buttons_padding"
                        android:scaleType="fitXY"
                        app:srcCompat="@drawable/ic_share"
                        app:tint="@color/white"
                        tools:ignore="RtlHardcoded" />

                    <androidx.appcompat.widget.AppCompatImageButton
                        android:id="@+id/switchMute"
                        android:layout_width="wrap_content"
                        android:layout_height="37dp"
                        android:layout_marginEnd="8dp"
                        android:background="?attr/selectableItemBackgroundBorderless"
                        android:clickable="true"
                        android:contentDescription="@string/mute"
                        android:focusable="true"
                        android:padding="@dimen/player_main_buttons_padding"
                        android:scaleType="fitXY"
                        app:srcCompat="@drawable/ic_volume_off"
                        app:tint="@color/white"
                        tools:ignore="RtlHardcoded" />

                    <androidx.appcompat.widget.AppCompatImageButton
                            android:id="@+id/sleep_timer"
                            android:layout_width="35dp"
                            android:layout_height="35dp"
                            android:background="?attr/selectableItemBackgroundBorderless"
                            android:clickable="true"
                            android:contentDescription="@string/sleep_timer_length_title"
                            android:focusable="true"
                            android:padding="@dimen/player_main_buttons_padding"
                            android:scaleType="fitCenter"
                            app:srcCompat="@drawable/ic_timer_off"
                            app:tint="@color/white"
                            tools:ignore="RtlHardcoded" />

                    <androidx.appcompat.widget.AppCompatImageButton
                        android:id="@+id/fullScreenButton"
                        android:layout_width="40dp"
                        android:layout_height="40dp"
                        android:background="?attr/selectableItemBackgroundBorderless"
                        android:clickable="true"
                        android:focusable="true"
                        android:padding="@dimen/player_main_buttons_padding"
                        android:scaleType="fitCenter"
                        android:visibility="gone"
                        app:srcCompat="@drawable/ic_fullscreen"
                        app:tint="@color/white"
                        tools:ignore="ContentDescription,RtlHardcoded"
                        tools:visibility="visible" />

                </LinearLayout>

            </LinearLayout>

            <LinearLayout
                android:id="@+id/bottomSeekbarPreviewLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_above="@id/bottomControls"
                android:orientation="horizontal">

                <LinearLayout
                    android:id="@+id/seekbarPreviewContainer"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:orientation="vertical"
                    android:paddingBottom="12dp">

                    <org.schabi.newpipe.views.NewPipeTextView
                        android:id="@+id/currentDisplaySeek"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:background="#60000000"
                        android:paddingLeft="5dp"
                        android:paddingRight="5dp"
                        android:paddingBottom="2dp"
                        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" />

                    <ImageView
                        android:id="@+id/currentSeekbarPreviewThumbnail"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:paddingTop="2dp"
                        android:visibility="gone"
                        app:srcCompat="@drawable/dummy_thumbnail"
                        tools:visibility="visible" />

                </LinearLayout>

            </LinearLayout>

            <LinearLayout
                android:id="@+id/bottomControls"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:gravity="center"
                android:minHeight="40dp"
                android:orientation="horizontal"
                android:paddingLeft="@dimen/player_main_controls_padding"
                android:paddingRight="@dimen/player_main_controls_padding">

                <org.schabi.newpipe.views.NewPipeTextView
                    android:id="@+id/playbackCurrentTime"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:gravity="center"
                    android:minHeight="30dp"
                    android:text="-:--:--"
                    android:textColor="@android:color/white"
                    tools:ignore="HardcodedText"
                    tools:text="1:06:29" />


                <org.schabi.newpipe.views.FocusAwareSeekBar
                    android:id="@+id/playbackSeekBar"
                    style="@style/Widget.AppCompat.SeekBar"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:layout_marginTop="2dp"
                    android:layout_weight="1"
                    android:nextFocusDown="@id/screenRotationButton"
                    tools:progress="25"
                    tools:secondaryProgress="50" />

                <org.schabi.newpipe.views.NewPipeTextView
                    android:id="@+id/playbackEndTime"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:gravity="center"
                    android:text="-:--:--"
                    android:textColor="@android:color/white"
                    tools:ignore="HardcodedText"
                    tools:text="1:23:49" />

                <org.schabi.newpipe.views.NewPipeTextView
                    android:id="@+id/playbackLiveSync"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:background="?attr/selectableItemBackgroundBorderless"
                    android:gravity="center"
                    android:paddingLeft="4dp"
                    android:paddingRight="4dp"
                    android:text="@string/duration_live"
                    android:textAllCaps="true"
                    android:textColor="@android:color/white"
                    android:visibility="gone"
                    tools:ignore="HardcodedText,RtlHardcoded,RtlSymmetry" />

                <androidx.appcompat.widget.AppCompatImageButton
                    android:id="@+id/screenRotationButton"
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:layout_marginStart="4dp"
                    android:background="?attr/selectableItemBackgroundBorderless"
                    android:clickable="true"
                    android:focusable="true"
                    android:nextFocusUp="@id/playbackSeekBar"
                    android:padding="@dimen/player_main_buttons_padding"
                    android:scaleType="fitCenter"
                    android:visibility="gone"
                    app:srcCompat="@drawable/ic_fullscreen"
                    app:tint="@color/white"
                    tools:ignore="ContentDescription,RtlHardcoded"
                    tools:visibility="visible" />
            </LinearLayout>
        </RelativeLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:id="@+id/playButtons"
            android:layout_height="match_parent"
            android:gravity="center"
            android:orientation="horizontal"
            android:weightSum="5.5">

            <androidx.appcompat.widget.AppCompatImageButton
                android:id="@+id/playPreviousButton"
                android:layout_width="0dp"
                android:layout_height="40dp"
                android:layout_marginEnd="10dp"
                android:layout_weight="1"
                android:background="?attr/selectableItemBackgroundBorderless"
                android:clickable="true"
                android:focusable="true"
                android:scaleType="fitCenter"
                app:srcCompat="@drawable/ic_previous"
                app:tint="@color/white"
                tools:ignore="ContentDescription" />


            <androidx.appcompat.widget.AppCompatImageButton
                android:id="@+id/playPauseButton"
                android:layout_width="0dp"
                android:layout_height="60dp"
                android:layout_weight="1"
                android:background="?attr/selectableItemBackgroundBorderless"
                android:scaleType="fitCenter"
                app:srcCompat="@drawable/ic_pause"
                app:tint="@color/white"
                tools:ignore="ContentDescription" />

            <androidx.appcompat.widget.AppCompatImageButton
                android:id="@+id/playNextButton"
                android:layout_width="0dp"
                android:layout_height="40dp"
                android:layout_marginStart="10dp"
                android:layout_weight="1"
                android:background="?attr/selectableItemBackgroundBorderless"
                android:clickable="true"
                android:focusable="true"
                android:scaleType="fitCenter"
                app:srcCompat="@drawable/ic_next"
                app:tint="@color/white"
                tools:ignore="ContentDescription" />

        </LinearLayout>

    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/itemsListPanel"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/queue_background_color"
        android:visibility="gone"
        tools:visibility="visible">

        <RelativeLayout
            android:id="@+id/itemsListControl"
            android:layout_width="match_parent"
            android:layout_height="60dp">

            <androidx.appcompat.widget.AppCompatTextView
                android:id="@+id/itemsListHeaderTitle"
                style="@style/TextAppearance.AppCompat.Medium"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignEnd="@id/itemsListClose"
                android:layout_alignParentStart="true"
                android:layout_centerVertical="true"
                android:layout_marginStart="16dp"
                android:layout_marginEnd="56dp"
                android:ellipsize="end"
                android:maxLines="2"
                android:text="@string/chapters"
                android:textColor="@android:color/white"
                android:visibility="gone" />

            <androidx.appcompat.widget.AppCompatImageButton
                android:id="@+id/repeatButton"
                android:layout_width="50dp"
                android:layout_height="50dp"
                android:layout_alignParentStart="true"
                android:layout_alignParentLeft="true"
                android:layout_centerVertical="true"
                android:layout_marginStart="40dp"
                android:layout_marginLeft="40dp"
                android:background="?attr/selectableItemBackgroundBorderless"
                android:clickable="true"
                android:focusable="true"
                android:padding="10dp"
                android:scaleType="fitXY"
                android:tint="?attr/colorAccent"
                app:srcCompat="@drawable/exo_controls_repeat_off"
                tools:ignore="ContentDescription,RtlHardcoded" />

            <androidx.appcompat.widget.AppCompatImageButton
                android:id="@+id/shuffleButton"
                android:layout_width="50dp"
                android:layout_height="50dp"
                android:layout_centerVertical="true"
                android:layout_toRightOf="@id/repeatButton"
                android:background="?attr/selectableItemBackgroundBorderless"
                android:clickable="true"
                android:focusable="true"
                android:padding="10dp"
                android:scaleType="fitXY"
                android:tint="?attr/colorAccent"
                app:srcCompat="@drawable/ic_shuffle"
                tools:ignore="ContentDescription,RtlHardcoded" />

            <androidx.appcompat.widget.AppCompatTextView
                android:id="@+id/itemsListHeaderDuration"
                style="@style/TextAppearance.AppCompat.Medium"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_toStartOf="@id/addToPlaylistButton"
                android:layout_toEndOf="@id/shuffleButton"
                android:gravity="center"
                android:textColor="@android:color/white" />

            <androidx.appcompat.widget.AppCompatImageButton
                android:id="@+id/addToPlaylistButton"
                android:layout_width="50dp"
                android:layout_height="50dp"
                android:layout_centerVertical="true"
                android:layout_toLeftOf="@+id/itemsListClose"
                android:background="?attr/selectableItemBackgroundBorderless"
                android:clickable="true"
                android:focusable="true"
                android:padding="10dp"
                android:scaleType="fitXY"
                android:tint="?attr/colorAccent"
                app:srcCompat="@drawable/ic_playlist_add"
                tools:ignore="ContentDescription,RtlHardcoded" />

            <androidx.appcompat.widget.AppCompatImageButton
                android:id="@+id/itemsListClose"
                android:layout_width="50dp"
                android:layout_height="50dp"
                android:layout_alignParentEnd="true"
                android:layout_centerVertical="true"
                android:layout_marginEnd="40dp"
                android:background="?attr/selectableItemBackgroundBorderless"
                android:clickable="true"
                android:contentDescription="@string/close"
                android:focusable="true"
                android:padding="10dp"
                android:scaleType="fitXY"
                app:srcCompat="@drawable/ic_close"
                app:tint="@color/white" />

        </RelativeLayout>

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/itemsList"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_below="@id/itemsListControl"
            android:scrollbars="vertical"
            android:theme="@style/PlayQueueItemTextTheme"
            app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
            tools:listitem="@layout/play_queue_item" />

    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/player_overlays"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@+id/loading_panel_wrapper">
            <RelativeLayout
                android:id="@+id/loading_panel"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@android:color/black"
                tools:visibility="gone">

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

                <TextView
                    android:id="@+id/sabrBackoffCountdown"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@id/progressBarLoadingPanel"
                    android:layout_centerHorizontal="true"
                    android:layout_marginHorizontal="24dp"
                    android:layout_marginTop="16dp"
                    android:gravity="center"
                    android:textAlignment="center"
                    android:textColor="@android:color/white"
                    android:textSize="14sp"
                    android:visibility="gone"
                    tools:text="YouTube requires us to wait 7 seconds before continuing playback" />
            </RelativeLayout>
        </RelativeLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            tools:ignore="RtlHardcoded">

            <RelativeLayout
                android:id="@+id/volumeRelativeLayout"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                android:background="@drawable/background_oval_black_transparent"
                android:visibility="gone"
                tools:visibility="visible">

                <ProgressBar
                    android:id="@+id/volumeProgressBar"
                    style="?android:progressBarStyleHorizontal"
                    android:layout_width="128dp"
                    android:layout_height="128dp"
                    android:indeterminate="false"
                    android:progressDrawable="@drawable/progress_circular_white" />

                <androidx.appcompat.widget.AppCompatImageView
                    android:id="@+id/volumeImageView"
                    android:layout_width="70dp"
                    android:layout_height="70dp"
                    android:layout_centerInParent="true"
                    app:tint="@color/white"
                    tools:ignore="ContentDescription"
                    tools:src="@drawable/ic_volume_up" />
            </RelativeLayout>

            <RelativeLayout
                android:id="@+id/brightnessRelativeLayout"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                android:background="@drawable/background_oval_black_transparent"
                android:visibility="gone"
                tools:visibility="visible">

                <ProgressBar
                    android:id="@+id/brightnessProgressBar"
                    style="?android:progressBarStyleHorizontal"
                    android:layout_width="128dp"
                    android:layout_height="128dp"
                    android:indeterminate="false"
                    android:progressDrawable="@drawable/progress_circular_white" />

                <androidx.appcompat.widget.AppCompatImageView
                    android:id="@+id/brightnessImageView"
                    android:layout_width="70dp"
                    android:layout_height="70dp"
                    android:layout_centerInParent="true"
                    app:tint="@color/white"
                    tools:ignore="ContentDescription"
                    tools:src="@drawable/ic_brightness_high" />
            </RelativeLayout>

            <RelativeLayout
                android:id="@+id/unskipButton"
                android:visibility="gone"
                android:clickable="true"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_alignParentLeft="true"
                android:layout_marginLeft="10dp"
                android:background="@drawable/background_rectangle_black_transparent"
                android:padding="@dimen/player_main_buttons_padding">

                <androidx.appcompat.widget.AppCompatImageButton
                    android:id="@+id/tooltipUnskipIcon"
                    android:src="@drawable/ic_previous"
                    android:clickable="false"
                    app:tint="@color/white"
                    android:background="?attr/selectableItemBackgroundBorderless"
                    android:scaleType="fitXY"
                    android:layout_width="25dp"
                    android:layout_height="25dp"
                    android:layout_centerVertical="true" />

                <TextView
                    android:id="@+id/tooltipUnskipText"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/sponsor_block_manual_unskip_button"
                    android:paddingRight="5dp"
                    android:layout_toRightOf="@+id/tooltipUnskipIcon"
                    android:layout_centerVertical="true"
                    android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                    android:textColor="#FFFFFF" />
            </RelativeLayout>

            <RelativeLayout
                android:id="@+id/skipButton"
                android:clickable="true"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_alignParentRight="true"
                android:layout_marginRight="10dp"
                android:background="@drawable/background_rectangle_black_transparent"
                android:visibility="gone"
                android:padding="@dimen/player_main_buttons_padding">

                <androidx.appcompat.widget.AppCompatImageButton
                    android:id="@+id/tooltipSkipIcon"
                    android:src="@drawable/ic_next"
                    android:clickable="false"
                    app:tint="@color/white"
                    android:background="?attr/selectableItemBackgroundBorderless"
                    android:scaleType="fitXY"
                    android:layout_width="25dp"
                    android:layout_height="25dp"
                    android:layout_toRightOf="@+id/tooltipSkipText"
                    android:layout_centerVertical="true" />

                <TextView
                    android:id="@+id/tooltipSkipText"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/sponsor_block_manual_skip_button"
                    android:paddingLeft="5dp"
                    android:layout_centerVertical="true"
                    android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                    android:textColor="#FFFFFF" />
            </RelativeLayout>

        </RelativeLayout>

    </RelativeLayout>

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

    <Button
        android:id="@+id/closeButton"
        style="@style/Widget.AppCompat.Button.Borderless"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:layout_marginTop="10dp"
        android:background="?attr/selectableItemBackgroundBorderless"
        android:clickable="true"
        android:focusable="true"
        android:text="@string/close"
        android:textAllCaps="true"
        android:textColor="@color/white"
        android:visibility="gone" />

    <org.schabi.newpipe.views.player.PlayerFastSeekOverlay
        android:id="@+id/fast_seek_overlay"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:alpha="0"
        android:visibility="invisible" /> <!-- Required for the first appearance fading correctly -->

    <org.schabi.newpipe.views.NewPipeTextView
        android:id="@+id/swipeSeekDisplay"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:background="@drawable/background_rectangle_black_transparent"
        android:padding="8dp"
        android:textColor="@android:color/white"
        android:textSize="22sp"
        android:textStyle="bold"
        android:visibility="gone"
        tools:ignore="RtlHardcoded"
        tools:text="+0:00 (0:00)" />

    <org.schabi.newpipe.views.NewPipeTextView
        android:id="@+id/swipeSpeedDisplay"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:background="@drawable/background_rectangle_black_transparent"
        android:padding="8dp"
        android:textColor="@android:color/white"
        android:textSize="22sp"
        android:textStyle="bold"
        android:visibility="gone"
        tools:ignore="RtlHardcoded"
        tools:text="1.0x" />

    <org.schabi.newpipe.views.BulletCommentsView
        android:id="@+id/bulletCommentsView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</RelativeLayout>
