<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/player_controls"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/playback_controls_background">

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:theme="@style/ThemeOverlay.App.BackButton"
        app:contentInsetStartWithNavigation="0dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:navigationIcon="?attr/homeAsUpIndicator"
        tools:title="Star Wars: A New Hope" />

    <androidx.appcompat.widget.AppCompatImageButton
        android:id="@+id/previous_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="@dimen/exo_center_controls_distance"
        android:background="@drawable/ripple_background_circular"
        android:padding="@dimen/exo_center_icon_padding"
        android:src="@drawable/ic_skip_previous_black_32dp"
        android:tint="?android:textColorPrimary"
        app:layout_constraintBottom_toBottomOf="@id/play_pause_container"
        app:layout_constraintEnd_toStartOf="@id/previous_chapter_button"
        app:layout_constraintTop_toTopOf="@id/play_pause_container" />

    <androidx.appcompat.widget.AppCompatImageButton
        android:id="@+id/previous_chapter_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="@dimen/exo_center_controls_distance"
        android:background="@drawable/ripple_background_circular"
        android:padding="@dimen/exo_center_icon_padding"
        android:src="@drawable/ic_skip_previous_chapter_black_32dp"
        android:tint="?android:textColorPrimary"
        app:layout_constraintBottom_toBottomOf="@id/play_pause_container"
        app:layout_constraintEnd_toStartOf="@id/play_pause_container"
        app:layout_constraintTop_toTopOf="@id/play_pause_container" />

    <FrameLayout
        android:id="@+id/play_pause_container"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <androidx.appcompat.widget.AppCompatImageButton
            android:id="@+id/exo_play_pause"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/ripple_background_circular"
            android:padding="@dimen/exo_center_icon_padding"
            android:tint="?android:textColorPrimary" />
    </FrameLayout>

    <androidx.appcompat.widget.AppCompatImageButton
        android:id="@+id/next_chapter_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/exo_center_controls_distance"
        android:background="@drawable/ripple_background_circular"
        android:padding="@dimen/exo_center_icon_padding"
        android:src="@drawable/ic_skip_next_chapter_black_32dp"
        android:tint="?android:textColorPrimary"
        app:layout_constraintBottom_toBottomOf="@id/play_pause_container"
        app:layout_constraintStart_toEndOf="@id/play_pause_container"
        app:layout_constraintTop_toTopOf="@id/play_pause_container" />

    <androidx.appcompat.widget.AppCompatImageButton
        android:id="@+id/next_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/exo_center_controls_distance"
        android:background="@drawable/ripple_background_circular"
        android:padding="@dimen/exo_center_icon_padding"
        android:src="@drawable/ic_skip_next_black_32dp"
        android:tint="?android:textColorPrimary"
        app:layout_constraintBottom_toBottomOf="@id/play_pause_container"
        app:layout_constraintStart_toEndOf="@id/next_chapter_button"
        app:layout_constraintTop_toTopOf="@id/play_pause_container" />

    <androidx.appcompat.widget.AppCompatTextView
        android:id="@+id/exo_position"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/exo_player_controls_display_padding"
        android:textColor="?android:textColorPrimary"
        app:layout_constraintBottom_toBottomOf="@id/seek_bar_container"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="@id/seek_bar_container"
        tools:text="33:01" />

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/seek_bar_container"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginBottom="4dp"
        app:layout_constraintBottom_toTopOf="@id/controls_barrier"
        app:layout_constraintEnd_toStartOf="@id/exo_duration"
        app:layout_constraintStart_toEndOf="@id/exo_position">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/chapter_marking_container"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_marginStart="11dp"
            android:layout_marginEnd="11dp"
            android:orientation="horizontal"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"></androidx.constraintlayout.widget.ConstraintLayout>

        <androidx.media3.ui.DefaultTimeBar
            android:id="@+id/exo_progress"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:played_color="?colorAccent"
            app:scrubber_color="?colorAccent"
            app:scrubber_dragged_size="24dp"
            app:scrubber_enabled_size="16dp"
            app:unplayed_color="@color/playback_timebar_unplayed" />
    </androidx.constraintlayout.widget.ConstraintLayout>

    <androidx.appcompat.widget.AppCompatTextView
        android:id="@+id/exo_duration"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="@dimen/exo_player_controls_display_padding"
        android:textColor="?android:textColorPrimary"
        app:layout_constraintBottom_toBottomOf="@id/seek_bar_container"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="@id/seek_bar_container"
        tools:text="0:49:04" />

    <androidx.constraintlayout.widget.Barrier
        android:id="@+id/controls_barrier"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:barrierDirection="top"
        app:constraint_referenced_ids="audio_streams_button,subtitles_button,fullscreen_switcher" />

    <androidx.appcompat.widget.AppCompatImageButton
        android:id="@+id/lock_screen_button"
        android:layout_width="@dimen/exo_bottom_controls_size"
        android:layout_height="@dimen/exo_bottom_controls_size"
        android:layout_marginStart="@dimen/exo_bottom_controls_margin"
        android:layout_marginBottom="@dimen/exo_bottom_controls_margin"
        android:background="@drawable/ripple_background_circular"
        android:padding="@dimen/exo_bottom_controls_padding"
        android:src="@drawable/ic_screen_lock_white_24dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <androidx.appcompat.widget.AppCompatImageButton
        android:id="@+id/audio_streams_button"
        android:layout_width="@dimen/exo_bottom_controls_size"
        android:layout_height="@dimen/exo_bottom_controls_size"
        android:layout_marginBottom="@dimen/exo_bottom_controls_margin"
        android:background="@drawable/ripple_background_circular"
        android:padding="@dimen/exo_bottom_controls_padding"
        android:src="@drawable/ic_music_note_white_24dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toEndOf="@id/lock_screen_button" />

    <androidx.appcompat.widget.AppCompatImageButton
        android:id="@+id/subtitles_button"
        android:layout_width="@dimen/exo_bottom_controls_size"
        android:layout_height="@dimen/exo_bottom_controls_size"
        android:layout_marginBottom="@dimen/exo_bottom_controls_margin"
        android:background="@drawable/ripple_background_circular"
        android:padding="@dimen/exo_bottom_controls_padding"
        android:src="@drawable/ic_subtitles_stateful_24dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toEndOf="@id/audio_streams_button" />

    <androidx.appcompat.widget.AppCompatImageButton
        android:id="@+id/speed_button"
        android:layout_width="@dimen/exo_bottom_controls_size"
        android:layout_height="@dimen/exo_bottom_controls_size"
        android:layout_marginBottom="@dimen/exo_bottom_controls_margin"
        android:background="@drawable/ripple_background_circular"
        android:padding="@dimen/exo_bottom_controls_padding"
        android:src="@drawable/ic_slow_motion_video_white_24dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toEndOf="@id/subtitles_button" />

    <androidx.appcompat.widget.AppCompatImageButton
        android:id="@+id/quality_button"
        android:layout_width="@dimen/exo_bottom_controls_size"
        android:layout_height="@dimen/exo_bottom_controls_size"
        android:layout_marginBottom="@dimen/exo_bottom_controls_margin"
        android:background="@drawable/ripple_background_circular"
        android:padding="@dimen/exo_bottom_controls_padding"
        android:src="@drawable/ic_settings_white_24dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toEndOf="@id/speed_button" />

    <androidx.appcompat.widget.AppCompatImageButton
        android:id="@+id/decoder_button"
        android:layout_width="@dimen/exo_bottom_controls_size"
        android:layout_height="@dimen/exo_bottom_controls_size"
        android:layout_marginBottom="@dimen/exo_bottom_controls_margin"
        android:background="@drawable/ripple_background_circular"
        android:padding="@dimen/exo_bottom_controls_padding"
        android:src="@drawable/ic_video_settings_white_24dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toEndOf="@id/quality_button" />

    <androidx.appcompat.widget.AppCompatImageButton
        android:id="@+id/info_button"
        android:layout_width="@dimen/exo_bottom_controls_size"
        android:layout_height="@dimen/exo_bottom_controls_size"
        android:layout_marginBottom="@dimen/exo_bottom_controls_margin"
        android:background="@drawable/ripple_background_circular"
        android:padding="@dimen/exo_bottom_controls_padding"
        android:src="@drawable/ic_info_white_24dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toEndOf="@id/decoder_button" />

    <androidx.appcompat.widget.AppCompatImageButton
        android:id="@+id/fullscreen_switcher"
        android:layout_width="@dimen/exo_bottom_controls_size"
        android:layout_height="@dimen/exo_bottom_controls_size"
        android:layout_marginEnd="@dimen/exo_bottom_controls_margin"
        android:layout_marginBottom="@dimen/exo_bottom_controls_margin"
        android:background="@drawable/ripple_background_circular"
        android:padding="@dimen/exo_bottom_controls_padding"
        android:src="@drawable/ic_fullscreen_enter_white_32dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

    <FrameLayout
        android:id="@+id/trickplay_container"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="8dp"
        android:background="#282828"
        android:elevation="8dp"
        android:visibility="gone"
        app:layout_constraintBottom_toTopOf="@id/seek_bar_container"
        app:layout_constraintStart_toStartOf="parent">

        <androidx.appcompat.widget.AppCompatImageView
            android:id="@+id/trickplay_thumbnail"
            android:layout_width="wrap_content"
            android:layout_height="@dimen/trickplay_thumbnail_height"
            android:scaleType="fitXY" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:orientation="vertical"
            android:paddingStart="8dp"
            android:paddingTop="4dp"
            android:paddingEnd="8dp"
            android:paddingBottom="8dp">

            <androidx.appcompat.widget.AppCompatTextView
                android:id="@+id/trickplay_chapter_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:alpha="0.9"
                android:ellipsize="end"
                android:maxLines="1"
                android:shadowColor="#FF000000"
                android:shadowDx="0"
                android:shadowDy="0"
                android:shadowRadius="6"
                android:textColor="@android:color/white"
                android:textSize="14sp"
                android:visibility="gone" />

            <androidx.appcompat.widget.AppCompatTextView
                android:id="@+id/trickplay_time"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:shadowColor="#FF000000"
                android:shadowDx="0"
                android:shadowDy="0"
                android:shadowRadius="6"
                android:textColor="@android:color/white"
                android:textSize="20sp"
                android:textStyle="bold" />
        </LinearLayout>
    </FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
