<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView android:layout_width="match_parent"
    android:scrollbars="none"
    android:orientation="vertical"
    android:layout_height="wrap_content"
    android:fillViewport="true"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:paddingBottom="20dp"
        android:layout_height="wrap_content">

        <com.google.android.material.card.MaterialCardView
            android:id="@+id/frame_layout"
            android:layout_width="0dp"
            android:layout_height="0dp"
            app:cardCornerRadius="0dp"
            app:layout_constraintDimensionRatio="H,16:9"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent" >



            <androidx.media3.ui.PlayerView
                android:id="@+id/video_view"
                android:keepScreenOn="true"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layout_constraintTop_toTopOf="parent"
                app:resize_mode="fixed_height"
                app:use_controller="false" />

            <androidx.constraintlayout.widget.ConstraintLayout

                android:layout_width="match_parent"
                android:layout_height="match_parent">

                <ProgressBar
                    android:id="@+id/progress"
                    android:layout_width="wrap_content"
                    android:indeterminate="true"
                    android:translationZ="10dp"
                    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" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/pause"
                    android:visibility="gone"
                    android:clickable="false"
                    app:iconSize="50dp"
                    style="@style/Widget.Material3.Button.IconButton"
                    app:iconTint="?android:colorAccent"
                    app:icon="@drawable/exomedia_ic_play_arrow_white"
                    android:layout_width="wrap_content"
                    android:indeterminate="true"
                    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" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/rewind"
                    android:clickable="false"
                    app:iconSize="50dp"
                    style="@style/Widget.Material3.Button.IconButton"
                    app:iconTint="?android:colorAccent"
                    app:icon="@drawable/exomedia_ic_rewind_white"
                    android:layout_marginHorizontal="20dp"
                    android:layout_width="wrap_content"
                    android:contentDescription="@string/restart"
                    android:indeterminate="true"
                    app:layout_constraintHorizontal_bias="0.0"
                    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" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/mute"
                    style="@style/Widget.Material3.Button.IconButton"
                    android:layout_width="wrap_content"
                    android:contentDescription="@string/remove_audio"
                    android:layout_height="wrap_content"
                    app:icon="@drawable/ic_music"
                    app:iconSize="30dp"
                    app:iconTint="?android:colorAccent"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/forward"
                    android:clickable="false"
                    app:iconSize="50dp"
                    style="@style/Widget.Material3.Button.IconButton"
                    app:iconTint="?android:colorAccent"
                    app:icon="@drawable/exomedia_ic_fast_forward_white"
                    android:layout_marginHorizontal="20dp"
                    android:layout_width="wrap_content"
                    android:contentDescription="@string/end"
                    android:indeterminate="true"
                    app:layout_constraintHorizontal_bias="0.0"
                    android:layout_height="wrap_content"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />


                <TextView
                    android:id="@+id/durationText"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp"
                    android:background="#80000000"
                    android:clickable="false"
                    android:ellipsize="end"
                    android:gravity="center"
                    android:maxLength="17"
                    android:maxLines="1"
                    android:minWidth="30dp"
                    android:paddingHorizontal="5dp"
                    android:textColor="@color/white"
                    android:textSize="15sp"
                    android:textStyle="bold"
                    app:cornerRadius="10dp"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintStart_toStartOf="parent" />

            </androidx.constraintlayout.widget.ConstraintLayout>

        </com.google.android.material.card.MaterialCardView>


        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/cut_section"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_constraintTop_toBottomOf="@+id/frame_layout">


            <com.google.android.material.slider.RangeSlider
                android:id="@+id/rangeSlider"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginVertical="10dp"
                android:valueFrom="00.0"
                android:valueTo="100.0"
                app:labelBehavior="gone"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:thumbRadius="0dp"
                app:trackHeight="20dp"
                app:values="@array/initial_slider_values" />


            <LinearLayout
                android:id="@+id/linearLayout5"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="15dp"
                android:orientation="horizontal"
                app:layout_constraintBottom_toTopOf="@id/suggested_cuts"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/rangeSlider"
                app:layout_constraintVertical_bias="0.0">

                <com.google.android.material.textfield.TextInputLayout
                    android:id="@+id/from_textinput"
                    style="@style/Widget.Material3.TextInputLayout.FilledBox"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:minWidth="70dp"
                    android:hint="@string/start">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/from_textinput_edittext"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" />

                </com.google.android.material.textfield.TextInputLayout>

                <TextView
                    android:id="@+id/colon"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:paddingHorizontal="10dp"
                    android:text="-"
                    android:textSize="20sp"
                    android:textStyle="bold" />


                <com.google.android.material.textfield.TextInputLayout
                    android:id="@+id/to_textinput"
                    style="@style/Widget.Material3.TextInputLayout.FilledBox"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:hint="@string/end"
                    android:minWidth="70dp"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintStart_toEndOf="@+id/colon">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/to_textinput_edittext"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content" />

                </com.google.android.material.textfield.TextInputLayout>

            </LinearLayout>

            <LinearLayout
                android:id="@+id/suggested_cuts"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingHorizontal="20dp"
                android:paddingTop="10dp"
                android:orientation="vertical"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="0.533"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/linearLayout5"
                app:layout_constraintVertical_bias="0.0"
                >

                <TextView
                    android:id="@+id/suggestedLabel"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/suggested" />

                <HorizontalScrollView
                    android:layout_width="wrap_content"
                    android:scrollbars="none"
                    android:layout_height="wrap_content">

                    <com.google.android.material.chip.ChipGroup
                        android:id="@+id/chapters"
                        android:layout_width="wrap_content"
                        app:chipSpacingVertical="-10dp"
                        app:chipSpacing="0dp"
                        android:layout_height="wrap_content"
                        app:singleLine="true" />

                </HorizontalScrollView>


            </LinearLayout>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:paddingTop="10dp"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                android:layout_marginHorizontal="20dp"
                app:layout_constraintTop_toBottomOf="@+id/suggested_cuts"
                app:layout_constraintVertical_bias="1.0"
                >

                <Button
                    android:id="@+id/cancelButton"
                    style="@style/Widget.Material3.Button.ElevatedButton"
                    android:layout_width="wrap_content"
                    android:layout_marginEnd="10dp"
                    android:layout_height="wrap_content"
                    android:text="@string/cancel"
                    app:icon="@drawable/ic_baseline_delete_outline_24"/>

                <Button
                    android:id="@+id/okButton"
                    style="@style/Widget.Material3.Button.ElevatedButton"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/cut"
                    app:icon="@drawable/ic_check"/>

            </LinearLayout>

        </androidx.constraintlayout.widget.ConstraintLayout>

        <LinearLayout
            android:id="@+id/list_section"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingHorizontal="20dp"
            android:paddingVertical="10dp"
            app:layout_constraintTop_toBottomOf="@+id/frame_layout"
            android:orientation="vertical">

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <TextView
                    android:id="@+id/bottom_sheet_title"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:maxLines="2"
                    android:singleLine="false"
                    android:text="@string/cut"
                    android:textSize="25sp"
                    app:layout_constraintEnd_toStartOf="@+id/new_cut"
                    app:layout_constraintHorizontal_bias="0.0"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

                <Button
                    android:id="@+id/reset_all"
                    style="?attr/materialIconButtonFilledTonalStyle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="10dp"
                    app:icon="@drawable/ic_baseline_delete_outline_24"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toStartOf="@+id/new_cut"
                    app:layout_constraintTop_toTopOf="parent" />


                <Button
                    android:id="@+id/new_cut"
                    style="@style/Widget.Material3.Button.ElevatedButton.Icon"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:autoLink="all"
                    android:text="@string/new_cut"
                    app:icon="@drawable/ic_cut"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

            </androidx.constraintlayout.widget.ConstraintLayout>

            <ScrollView
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

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

                    <com.google.android.material.chip.ChipGroup
                        android:id="@+id/cut_list_chip_group"
                        android:paddingTop="10dp"
                        app:chipSpacingVertical="-7dp"
                        app:chipSpacingHorizontal="5dp"
                        app:singleSelection="true"
                        app:selectionRequired="false"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" >

                    </com.google.android.material.chip.ChipGroup>

                </LinearLayout>

            </ScrollView>

            <com.google.android.material.materialswitch.MaterialSwitch
                android:id="@+id/force_keyframes"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:visibility="gone"
                android:checked="true"
                android:textStyle="bold"
                android:textSize="15sp"
                android:text="@string/force_keyframes"/>

        </LinearLayout>

    </androidx.constraintlayout.widget.ConstraintLayout>

</androidx.core.widget.NestedScrollView>
