<?xml version="1.0" encoding="utf-8"?>
<merge 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">

    <View
        android:id="@id/exo_controls_background"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:background="@color/exo_black_opacity_60" />

    <LinearLayout
        android:id="@+id/exo_top_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="top"
        android:animateLayoutChanges="true"
        android:orientation="vertical"
        android:paddingStart="5dp"
        android:paddingTop="5dp"
        android:paddingEnd="10dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layoutDirection="ltr">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layoutDirection="ltr">

                <ImageView
                    android:id="@+id/close_imageButton"
                    style="@style/PlayerControlTop"
                    android:layout_marginEnd="-10dp"
                    android:src="@drawable/ic_close"
                    app:tint="@android:color/white" />

                <ImageView
                    android:id="@+id/lock_player"
                    style="@style/PlayerControlTop"
                    android:scaleX=".8"
                    android:scaleY=".8"
                    android:src="@drawable/ic_unlocked" />

            </LinearLayout>

            <TextView
                android:id="@+id/exo_title"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginHorizontal="10dp"
                android:layout_weight="1"
                android:ellipsize="end"
                android:maxLines="1"
                android:textColor="@android:color/white"
                android:textSize="18sp"
                android:visibility="invisible" />

            <LinearLayout
                android:id="@+id/exo_top_bar_right"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layoutDirection="ltr">

                <ImageButton
                    android:id="@+id/queue_toggle"
                    style="@style/PlayerControlTop"
                    android:layout_marginEnd="2dp"
                    android:src="@drawable/ic_queue"
                    android:visibility="gone"
                    app:tint="@android:color/white" />

                <ImageButton
                    android:id="@+id/toggle_options"
                    style="@style/PlayerControlTop"
                    android:src="@drawable/ic_arrow_down"
                    app:tint="@android:color/white" />

            </LinearLayout>

        </LinearLayout>

    </LinearLayout>

    <LinearLayout
        android:id="@id/exo_bottom_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:layout_marginTop="10dp"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:baselineAligned="false"
            android:paddingStart="10dp"
            android:paddingEnd="20dp">

            <LinearLayout
                android:id="@id/exo_time"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginStart="10dp">

                <TextView
                    android:id="@id/exo_position"
                    style="@style/TimeString"
                    android:text="00:00"
                    tools:ignore="HardcodedText" />

                <TextView
                    style="@style/TimeString"
                    android:text="  •  "
                    tools:ignore="HardcodedText" />

                <TextView
                    android:id="@id/exo_duration"
                    style="@style/TimeString"
                    android:text="00:00"
                    tools:ignore="HardcodedText" />

            </LinearLayout>

            <LinearLayout
                android:id="@+id/liveLL"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginStart="10dp"
                android:visibility="gone">

                <TextView
                    android:id="@+id/liveDiff"
                    style="@style/TimeString"
                    tools:text="05:10" />

                <TextView
                    android:id="@+id/liveSeparator"
                    style="@style/TimeString"
                    android:layout_marginHorizontal="5dp"
                    android:paddingHorizontal="0dp"
                    android:text="  •  "
                    android:visibility="gone"
                    tools:ignore="HardcodedText" />

                <TextView
                    android:id="@+id/liveIndicator"
                    style="@style/TimeString"
                    android:text="@string/live" />

            </LinearLayout>

            <LinearLayout
                android:id="@+id/chapterLL"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginStart="12dp"
                android:layout_marginEnd="12dp"
                android:layout_weight="1"
                android:visibility="invisible">

                <TextView
                    android:id="@+id/chapter_name"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:ellipsize="end"
                    android:maxLines="1"
                    android:textColor="@android:color/white" />

                <ImageView
                    android:layout_width="15dp"
                    android:layout_height="15dp"
                    android:layout_gravity="center"
                    android:layout_marginStart="3dp"
                    android:src="@drawable/ic_arrow_right" />

            </LinearLayout>

            <LinearLayout
                android:id="@id/exo_basic_controls"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">

                <ImageButton
                    android:id="@+id/fullscreen"
                    style="@style/PlayerControlBottom"
                    android:src="@drawable/ic_fullscreen"
                    app:tint="@android:color/white" />

            </LinearLayout>

        </LinearLayout>

        <LinearLayout
            android:id="@+id/progress_bar"
            android:layout_width="match_parent"
            android:layout_height="15dp"
            android:layout_gravity="bottom"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginBottom="10dp">

            <com.github.libretube.ui.views.MarkableTimeBar
                android:id="@id/exo_progress"
                android:layout_width="match_parent"
                android:layout_height="15dp"
                app:bar_height="2dp"
                app:played_color="?attr/colorSecondary"
                app:scrubber_color="?attr/colorSecondary"
                app:scrubber_dragged_size="15dp"
                app:scrubber_enabled_size="12dp" />

        </LinearLayout>

    </LinearLayout>

    <LinearLayout
        android:id="@id/exo_center_controls"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:background="@android:color/transparent"
        android:clipToPadding="false"
        android:gravity="center"
        android:padding="20dp">

        <ImageView
            android:id="@+id/skip_prev"
            style="@style/PlayerControlCenter"
            android:background="?android:selectableItemBackgroundBorderless"
            android:src="@drawable/ic_prev"
            android:visibility="invisible"
            app:tint="@android:color/white" />

        <ImageButton
            android:id="@id/exo_play_pause"
            style="@style/ExoStyledControls.Button.Center.PlayPause"
            android:background="?android:selectableItemBackgroundBorderless"
            app:tint="@android:color/white" />

        <ImageView
            android:id="@+id/skip_next"
            style="@style/PlayerControlCenter"
            android:background="?android:selectableItemBackgroundBorderless"
            android:src="@drawable/ic_next"
            android:visibility="invisible"
            app:tint="@android:color/white" />

    </LinearLayout>

</merge>