<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".activities.FolderActivity">

    <include layout="@layout/widget_toolbar" />

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

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:divider="?android:listDivider"
            android:orientation="vertical"
            android:paddingBottom="8dp"
            android:paddingTop="8dp"
            android:showDividers="middle">

            <EditText
                android:id="@+id/label"
                style="@style/Widget.Syncthing.TextView.Label.Details.Field"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:drawableLeftCompat="@drawable/baseline_sort_by_alpha_24"
                app:drawableStartCompat="@drawable/baseline_sort_by_alpha_24"
                android:hint="@string/folder_label"
                android:imeOptions="actionDone"
                android:inputType="textCapWords|textNoSuggestions"
                android:importantForAutofill="no" />

            <EditText
                android:id="@+id/id"
                style="@style/Widget.Syncthing.TextView.Label.Details.Field"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:drawableLeftCompat="@drawable/ic_id"
                app:drawableStartCompat="@drawable/ic_id"
                android:hint="@string/folder_id"
                android:imeOptions="actionDone"
                android:inputType="textCapWords"
                android:importantForAutofill="no" />

            <!-- Directory -->
            <LinearLayout
                android:id="@+id/showDirectoryContainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="?selectableItemBackground"
                android:orientation="horizontal"
                android:nextFocusDown="@+id/devicesContainer" >

                <TextView
                    android:id="@+id/directoryTextView"
                    style="@style/Widget.Syncthing.TextView.Label.Details.Field"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    app:drawableLeftCompat="@drawable/baseline_folder_24"
                    app:drawableStartCompat="@drawable/baseline_folder_24"
                    android:focusable="true"
                    android:hint="@string/directory"/>

                <ImageView
                    android:id="@+id/selectAdvancedDirectory"
                    style="?actionButtonStyle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:layout_marginEnd="@dimen/abc_action_bar_content_inset_material"
                    android:contentDescription="@string/advanced_directory_selection"
                    android:clickable="true"
                    android:focusable="true"
                    app:srcCompat="@drawable/baseline_settings_24" />

            </LinearLayout>

            <TextView
                style="@style/Widget.Syncthing.TextView.Label.Details"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:drawableLeftCompat="@drawable/ic_device_hub_black_24dp_active"
                app:drawableStartCompat="@drawable/ic_device_hub_black_24dp_active"
                android:focusable="false"
                android:text="@string/devices" />

            <LinearLayout
                android:id="@+id/devicesContainer"
                android:background="?selectableItemBackground"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:focusable="true">
            </LinearLayout>

            <LinearLayout
                android:id="@+id/folderTypeContainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="?selectableItemBackground"
                android:orientation="vertical"
                android:gravity="center_vertical"
                android:focusable="true">

                <TextView
                    style="@style/Widget.Syncthing.TextView.Label.Details"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_weight="1"
                    android:background="@null"
                    android:checked="false"
                    app:drawableLeftCompat="@drawable/filled_lock_24"
                    app:drawableStartCompat="@drawable/filled_lock_24"
                    android:text="@string/folder_type" />

                <TextView
                    android:id="@+id/folderType"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="75dp"
                    android:layout_marginTop="-20dp"
                    android:textAppearance="@style/TextAppearance.AppCompat.Caption" />

                <TextView
                    android:id="@+id/folderTypeDescription"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="75dp"
                    android:textAppearance="@style/TextAppearance.AppCompat.Caption" />

                <TextView
                    android:id="@+id/accessExplanationView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="75dp"
                    android:textAppearance="@style/TextAppearance.AppCompat.Caption" />

            </LinearLayout>

            <androidx.appcompat.widget.SwitchCompat
                android:id="@+id/fileWatcher"
                style="@style/Widget.Syncthing.TextView.Label.Details"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:checked="false"
                app:drawableLeftCompat="@drawable/outline_autorenew_24"
                app:drawableStartCompat="@drawable/outline_autorenew_24"
                android:text="@string/folder_fileWatcher" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="75dp"
                android:layout_marginTop="-20dp"
                android:textAppearance="@style/TextAppearance.AppCompat.Caption"
                android:text="@string/folder_fileWatcherDescription"
                android:focusable="false"/>

            <androidx.appcompat.widget.SwitchCompat
                android:id="@+id/folderPause"
                style="@style/Widget.Syncthing.TextView.Label.Details"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:checked="false"
                app:drawableLeftCompat="@drawable/baseline_pause_circle_outline_24"
                app:drawableStartCompat="@drawable/baseline_pause_circle_outline_24"
                android:text="@string/folder_pause" />

            <!-- Custom sync conditions -->
            <LinearLayout
                android:id="@+id/customSyncConditionsContainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="?selectableItemBackground"
                android:orientation="vertical"
                android:gravity="center_vertical">

                <androidx.appcompat.widget.SwitchCompat
                    android:id="@+id/customSyncConditionsSwitch"
                    style="@style/Widget.Syncthing.TextView.Label.Details"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:checked="false"
                    app:drawableLeftCompat="@drawable/outline_autorenew_24"
                    app:drawableStartCompat="@drawable/outline_autorenew_24"
                    android:text="@string/custom_sync_conditions_title" />

                <TextView
                    android:id="@+id/customSyncConditionsDescription"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="75dp"
                    android:layout_marginTop="-20dp"
                    android:textAppearance="@style/TextAppearance.AppCompat.Caption"
                    android:text="@string/custom_sync_conditions_description"
                    android:focusable="false"/>

                <TextView
                    android:id="@+id/customSyncConditionsDialog"
                    style="@style/Widget.Syncthing.TextView.Label.Details"
                    android:layout_marginStart="56dp"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/custom_sync_conditions_dialog"/>

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="75dp"
                    android:layout_marginTop="-20dp"
                    android:textAppearance="@style/TextAppearance.AppCompat.Caption"
                    android:text="@null"
                    android:focusable="false"/>

            </LinearLayout>

            <LinearLayout
                android:id="@+id/pullOrderContainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="?selectableItemBackground"
                android:orientation="vertical"
                android:gravity="center_vertical"
                android:focusable="true">

                <TextView
                    style="@style/Widget.Syncthing.TextView.Label.Details"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_weight="1"
                    android:background="@null"
                    android:checked="false"
                    app:drawableLeftCompat="@drawable/baseline_content_copy_24"
                    app:drawableStartCompat="@drawable/baseline_content_copy_24"
                    android:text="@string/pull_order" />

                <TextView
                    android:id="@+id/pullOrderType"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="75dp"
                    android:layout_marginTop="-20dp"
                    android:textAppearance="@style/TextAppearance.AppCompat.Caption" />

                <TextView
                    android:id="@+id/pullOrderDescription"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="75dp"
                    android:textAppearance="@style/TextAppearance.AppCompat.Caption" />

            </LinearLayout>

            <!-- Versioning -->
            <LinearLayout
                android:id="@+id/versioningContainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="?selectableItemBackground"
                android:orientation="vertical"
                android:gravity="center_vertical"
                android:focusable="true">

                <TextView
                    style="@style/Widget.Syncthing.TextView.Label.Details"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_weight="1"
                    android:background="@null"
                    android:checked="false"
                    app:drawableLeftCompat="@drawable/outline_restore_24"
                    app:drawableStartCompat="@drawable/outline_restore_24"
                    android:text="@string/file_versioning" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="75dp"
                    android:layout_marginTop="-20dp"
                    android:text="@string/file_versioning_generic_description"
                    android:textAppearance="@style/TextAppearance.AppCompat.Caption" />

                <TextView
                    android:id="@+id/versioningType"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="75dp"
                    android:textAppearance="@style/TextAppearance.AppCompat.Caption" />

                <TextView
                    android:id="@+id/versioningDescription"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="75dp"
                    android:textAppearance="@style/TextAppearance.AppCompat.Caption" />

            </LinearLayout>

            <!-- ignoreDelete mPrefExpertMode -->
            <LinearLayout
                android:id="@+id/ignoreDeleteContainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="?selectableItemBackground"
                android:orientation="vertical"
                android:gravity="center_vertical"
                android:focusable="true">

                <androidx.appcompat.widget.SwitchCompat
                    android:id="@+id/ignoreDelete"
                    style="@style/Widget.Syncthing.TextView.Label.Details"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:checked="false"
                    app:drawableLeftCompat="@drawable/baseline_delete_forever_24"
                    app:drawableStartCompat="@drawable/baseline_delete_forever_24"
                    android:text="@string/folder_ignore_delete_caption" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="75dp"
                    android:layout_marginTop="-20dp"
                    android:textAppearance="@style/TextAppearance.AppCompat.Caption"
                    android:text="@string/folder_ignore_delete_description"
                    android:focusable="false"/>

            </LinearLayout>

            <!-- runScript mPrefExpertMode -->
            <LinearLayout
                android:id="@+id/runScriptContainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="?selectableItemBackground"
                android:orientation="vertical"
                android:gravity="center_vertical"
                android:focusable="true">

                <androidx.appcompat.widget.SwitchCompat
                    android:id="@+id/runScriptSwitch"
                    style="@style/Widget.Syncthing.TextView.Label.Details"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:checked="false"
                    app:drawableLeftCompat="@drawable/terminal_24dp"
                    app:drawableStartCompat="@drawable/terminal_24dp"
                    android:text="@string/folder_run_script_caption" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="75dp"
                    android:layout_marginTop="-20dp"
                    android:textAppearance="@style/TextAppearance.AppCompat.Caption"
                    android:text="@string/folder_run_script_description"
                    android:focusable="false"/>

            </LinearLayout>

            <LinearLayout
                android:id="@+id/editIgnoresContainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="?selectableItemBackground"
                android:orientation="vertical"
                android:gravity="center_vertical">

                <TextView
                    android:id="@+id/edit_ignore_list_title"
                    style="@style/Widget.Syncthing.TextView.Label.Details"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_weight="1"
                    android:background="@null"
                    app:drawableLeftCompat="@drawable/ic_visibility_off_black_24dp"
                    app:drawableStartCompat="@drawable/ic_visibility_off_black_24dp"
                    android:text="@string/ignore_patterns"/>

                <EditText
                    android:id="@+id/edit_ignore_list_content"
                    style="@style/Widget.Syncthing.TextView.Label.Details"
                    android:inputType="textMultiLine|textNoSuggestions"
                    android:gravity="top|start"
                    android:hint="@string/ignore_patterns"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="55dp"
                    android:layout_marginTop="-20dp"
                    android:minLines="5"
                    android:maxLines="100"
                    android:scrollbars="none"
                    android:importantForAutofill="no"/>

            </LinearLayout>
        </LinearLayout>
    </ScrollView>

</LinearLayout>
