<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:tools="http://schemas.android.com/tools"
    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">

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

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginHorizontal="20dp"
            android:orientation="horizontal"
            android:paddingTop="20dp">

            <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/observe_sources"
                android:textSize="25sp"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <TextView
                android:id="@+id/bottom_sheet_subtitle"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:maxLines="2"
                android:singleLine="false"
                android:text="@string/configure_download"
                android:textSize="12sp"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/bottom_sheet_title" />

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


        </androidx.constraintlayout.widget.ConstraintLayout>

        <com.google.android.material.textfield.TextInputLayout
            android:id="@+id/title_textinput"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:paddingHorizontal="10dp"
            android:paddingBottom="10dp"
            android:hint="@string/title"
            style="@style/Widget.Material3.TextInputLayout.FilledBox">

            <com.google.android.material.textfield.TextInputEditText
                android:layout_width="match_parent"
                android:inputType="text"
                android:layout_height="wrap_content"
                />

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

        <com.google.android.material.textfield.TextInputLayout
            android:id="@+id/url_textinput"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingHorizontal="10dp"
            android:paddingBottom="10dp"
            android:hint="@string/url"
            app:endIconContentDescription="@string/import_from_clipboard"
            app:endIconMode="custom"
            app:endIconDrawable="@drawable/ic_clipboard"
            style="@style/Widget.Material3.TextInputLayout.FilledBox">

            <com.google.android.material.textfield.TextInputEditText
                android:layout_width="match_parent"
                android:inputType="textMultiLine"
                android:maxLines="3"
                android:layout_height="wrap_content"
                />

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


        <com.google.android.material.tabs.TabLayout
            android:id="@+id/download_tablayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginHorizontal="10dp"
            android:layout_marginBottom="10dp"
            android:backgroundTint="@android:color/transparent"
            app:tabGravity="start"
            app:tabMinWidth="0dp"
            app:tabMode="scrollable">

            <com.google.android.material.tabs.TabItem
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:text="@string/audio" />

            <com.google.android.material.tabs.TabItem
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:text="@string/video" />

            <com.google.android.material.tabs.TabItem
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:text="@string/command" />


        </com.google.android.material.tabs.TabLayout>

        <androidx.viewpager2.widget.ViewPager2
            android:id="@+id/download_viewpager"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <LinearLayout android:layout_width="match_parent"
            android:id="@+id/adjust"
            android:layout_height="wrap_content"
            android:paddingTop="10dp"
            android:orientation="vertical">

            <TextView
                android:layout_width="wrap_content"
                android:paddingBottom="15dp"
                android:paddingHorizontal="20dp"
                android:textSize="15sp"
                android:layout_height="wrap_content"
                android:text="@string/every" />


            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:paddingHorizontal="10dp"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <com.google.android.material.textfield.TextInputLayout
                    android:id="@+id/every_textinput"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    app:hintEnabled="false"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent">

                    <com.google.android.material.textfield.TextInputEditText
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="number"
                        android:text="1"
                        android:textAlignment="center" />

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


                <com.google.android.material.textfield.TextInputLayout
                    android:id="@+id/textInputLayout"
                    style="@style/Widget.Material3.TextInputLayout.FilledBox.ExposedDropdownMenu"
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:hint="@string/every"
                    android:paddingStart="10dp"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toStartOf="@+id/everyMonthDay_textInput"
                    app:layout_constraintStart_toEndOf="@+id/every_textinput"
                    app:layout_constraintTop_toTopOf="parent">

                    <AutoCompleteTextView
                        android:id="@+id/everyCat"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:inputType="none" />

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

                <com.google.android.material.textfield.TextInputLayout
                    android:id="@+id/everyMonthDay_textInput"
                    style="@style/Widget.Material3.TextInputLayout.FilledBox.ExposedDropdownMenu"
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:hint="@string/day"
                    android:paddingStart="10dp"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintTop_toTopOf="parent">

                    <AutoCompleteTextView
                        android:id="@+id/everyMonthDay"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:inputType="none"
                        app:simpleItems="@array/monthDays" />

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

            </androidx.constraintlayout.widget.ConstraintLayout>

            <com.google.android.material.chip.ChipGroup
                android:id="@+id/weekdays"
                android:layout_width="match_parent"
                app:chipSpacingVertical="0dp"
                android:paddingVertical="5dp"
                android:paddingHorizontal="10dp"
                android:layout_height="wrap_content">

                <com.google.android.material.chip.Chip
                    android:id="@+id/m"
                    style="@style/Widget.Material3.Chip.Suggestion.Elevated"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:checked="false"/>

                <com.google.android.material.chip.Chip
                    android:id="@+id/t"
                    style="@style/Widget.Material3.Chip.Suggestion.Elevated"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:checked="false"/>


                <com.google.android.material.chip.Chip
                    android:id="@+id/w"
                    style="@style/Widget.Material3.Chip.Suggestion.Elevated"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:checked="false"/>


                <com.google.android.material.chip.Chip
                    android:id="@+id/th"
                    style="@style/Widget.Material3.Chip.Suggestion.Elevated"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:checked="false"/>

                <com.google.android.material.chip.Chip
                    android:id="@+id/f"
                    style="@style/Widget.Material3.Chip.Suggestion.Elevated"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:checked="false"/>

                <com.google.android.material.chip.Chip
                    android:id="@+id/sa"
                    style="@style/Widget.Material3.Chip.Suggestion.Elevated"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:checked="false"/>

                <com.google.android.material.chip.Chip
                    android:id="@+id/su"
                    style="@style/Widget.Material3.Chip.Suggestion.Elevated"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:checked="true"/>


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

            <LinearLayout
                android:layout_width="match_parent"
                android:paddingHorizontal="10dp"
                android:paddingTop="10dp"
                android:layout_height="wrap_content"
                android:orientation="horizontal">


                <com.google.android.material.textfield.TextInputLayout
                    android:id="@+id/everyday_textInput"
                    android:visibility="gone"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:paddingEnd="10dp"
                    style="@style/Widget.Material3.TextInputLayout.FilledBox">

                    <com.google.android.material.textfield.TextInputEditText
                        android:layout_width="match_parent"
                        android:inputType="number"
                        android:textAlignment="center"
                        android:padding="15dp"
                        android:text="1"
                        android:layout_height="wrap_content"
                        />

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


                <com.google.android.material.textfield.TextInputLayout
                    android:id="@+id/every_time"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:paddingBottom="10dp"
                    android:hint="@string/set_time"
                    style="@style/Widget.Material3.TextInputLayout.FilledBox">

                    <com.google.android.material.textfield.TextInputEditText
                        android:layout_width="match_parent"
                        android:inputType="text"
                        android:layout_height="wrap_content"
                        />

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


            </LinearLayout>





            <TextView
                android:layout_width="wrap_content"
                android:paddingBottom="15dp"
                android:paddingHorizontal="20dp"
                android:textSize="15sp"
                android:layout_height="wrap_content"
                android:text="@string/starts" />

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/start_time"
                android:paddingHorizontal="10dp"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingBottom="10dp"
                android:hint="@string/starts"
                style="@style/Widget.Material3.TextInputLayout.FilledBox">

                <com.google.android.material.textfield.TextInputEditText
                    android:layout_width="match_parent"
                    android:inputType="text"
                    android:layout_height="wrap_content"
                    />

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

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/startsMonth_textInput"
                style="@style/Widget.Material3.TextInputLayout.FilledBox.ExposedDropdownMenu"
                android:layout_width="match_parent"
                android:layout_weight="45"
                android:paddingHorizontal="10dp"
                android:paddingBottom="10dp"
                android:layout_height="0dp">

                <AutoCompleteTextView
                    android:id="@+id/startsMonth"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:padding="15dp"
                    android:inputType="none"
                    />

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

            <TextView
                android:layout_width="wrap_content"
                android:paddingHorizontal="20dp"
                android:textSize="15sp"
                android:layout_height="wrap_content"
                android:text="@string/ends" />



            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingHorizontal="10dp"
                android:paddingBottom="20dp"
                android:orientation="vertical">

                <RadioButton
                    android:id="@+id/never"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:paddingHorizontal="10dp"
                    android:checked="true"
                    android:text="@string/never" />

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="10dp"
                    android:weightSum="5"
                    android:orientation="horizontal">

                    <RadioButton
                        android:id="@+id/on"
                        android:layout_width="0dp"
                        app:layout_constraintWidth_percent="0.4"
                        android:layout_height="wrap_content"
                        android:paddingHorizontal="10dp"
                        android:text="@string/on_time"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent" />

                    <com.google.android.material.textfield.TextInputLayout
                        android:id="@+id/on_date"
                        style="@style/Widget.Material3.TextInputLayout.FilledBox"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="3"
                        app:hintEnabled="false"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toEndOf="@+id/on"
                        app:layout_constraintTop_toTopOf="parent">

                        <com.google.android.material.textfield.TextInputEditText
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:inputType="text"
                            android:padding="15dp" />

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

                </androidx.constraintlayout.widget.ConstraintLayout>

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:weightSum="5"
                    android:orientation="horizontal">

                    <RadioButton
                        android:id="@+id/after"
                        android:layout_width="0dp"
                        app:layout_constraintWidth_percent="0.4"
                        android:layout_height="wrap_content"
                        android:paddingHorizontal="10dp"
                        android:text="@string/after"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent" />

                    <com.google.android.material.textfield.TextInputLayout
                        android:id="@+id/after_nr"
                        style="@style/Widget.Material3.TextInputLayout.FilledBox.Dense"
                        android:layout_width="wrap_content"
                        android:layout_height="match_parent"
                        app:layout_constraintStart_toEndOf="@+id/after">

                        <com.google.android.material.textfield.TextInputEditText
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:inputType="number"
                            android:padding="15dp"
                            android:text="1"
                            android:textAlignment="center" />

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

                    <TextView
                        android:id="@+id/textView8"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:paddingHorizontal="10dp"
                        android:maxLines="2"
                        app:layout_constraintHorizontal_bias="0.0"
                        android:text="@string/occurrences"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toEndOf="@+id/after_nr"
                        app:layout_constraintTop_toTopOf="parent" />

                </androidx.constraintlayout.widget.ConstraintLayout>

                <com.google.android.material.materialswitch.MaterialSwitch
                    android:id="@+id/get_new_uploads"
                    android:layout_width="match_parent"
                    android:layout_marginTop="20dp"
                    android:layout_height="wrap_content"
                    android:checked="false"
                    android:text="@string/get_new_uploads"/>

                <com.google.android.material.materialswitch.MaterialSwitch
                    android:id="@+id/sync_with_source"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:checked="false"
                    android:text="@string/sync_with_source"/>

                <com.google.android.material.materialswitch.MaterialSwitch
                    android:id="@+id/retry_missing_downloads"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:checked="false"
                    android:text="@string/retry_missing_downloads"/>

                <com.google.android.material.materialswitch.MaterialSwitch
                    android:id="@+id/reset_processed_links"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:checked="false"
                    android:text="@string/reset_processed_links"/>

            </LinearLayout>

        </LinearLayout>

    </LinearLayout>

</androidx.core.widget.NestedScrollView>