<?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"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <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">

            <!-- Static Sync Condition Title -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="?selectableItemBackground"
                android:orientation="vertical"
                android:gravity="center_vertical">

                <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_autorenew_24"
                    app:drawableStartCompat="@drawable/outline_autorenew_24"
                    android:text="@string/run_conditions_title" />

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

            </LinearLayout>

            <!-- Sync on WiFi -->
            <LinearLayout
                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/sync_on_wifi_title"
                    style="@style/Widget.Syncthing.TextView.Label.Details"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:checked="false"
                    app:drawableLeftCompat="@drawable/baseline_wifi_24"
                    app:drawableStartCompat="@drawable/baseline_wifi_24"
                    android:text="@string/run_on_wifi_title" />

                <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/run_on_wifi_summary"
                    android:focusable="false"/>

            </LinearLayout>

            <!-- Sync on whitelisted WiFi -->
            <LinearLayout
                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/sync_on_whitelisted_wifi_title"
                    style="@style/Widget.Syncthing.TextView.Label.Details"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:checked="false"
                    app:drawableLeftCompat="@drawable/outline_signal_wifi_4_bar_24"
                    app:drawableStartCompat="@drawable/outline_signal_wifi_4_bar_24"
                    android:text="@string/run_on_whitelisted_wifi_title" />

                <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/run_on_whitelisted_wifi_summary"
                    android:focusable="false"/>

                <LinearLayout
                    android:id="@+id/wifiSsidContainer"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical" />

            </LinearLayout>

            <!-- Sync on metered WiFi -->
            <LinearLayout
                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/sync_on_metered_wifi_title"
                    style="@style/Widget.Syncthing.TextView.Label.Details"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:checked="false"
                    app:drawableLeftCompat="@drawable/baseline_wifi_tethering_24"
                    app:drawableStartCompat="@drawable/baseline_wifi_tethering_24"
                    android:text="@string/run_on_metered_wifi_title" />

                <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/run_on_metered_wifi_summary"
                    android:focusable="false"/>

            </LinearLayout>

            <!-- Sync on mobile data -->
            <LinearLayout
                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/sync_on_mobile_data_title"
                    style="@style/Widget.Syncthing.TextView.Label.Details"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:checked="false"
                    app:drawableLeftCompat="@drawable/outline_signal_cellular_connected_no_internet_4_bar_24"
                    app:drawableStartCompat="@drawable/outline_signal_cellular_connected_no_internet_4_bar_24"
                    android:text="@string/run_on_mobile_data_title" />

                <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/run_on_mobile_data_summary"
                    android:focusable="false"/>

            </LinearLayout>

            <!-- Sync on power source -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="?selectableItemBackground"
                android:orientation="vertical"
                android:gravity="center_vertical">

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    style="@style/Widget.Syncthing.TextView.Label.Details"
                    android:textAppearance="@style/TextAppearance.AppCompat.Caption"
                    android:text="@string/power_source_title"
                    android:textSize="15sp"
                    app:drawableLeftCompat="@drawable/ic_battery_lightning_black_24dp"
                    app:drawableStartCompat="@drawable/ic_battery_lightning_black_24dp"
                    android:focusable="false"/>

                <androidx.appcompat.widget.AppCompatSpinner
                    android:id="@+id/sync_on_power_source_title"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="75dp"
                    android:layout_marginTop="-20dp"
                    android:entries="@array/power_source_entries" />

            </LinearLayout>

        </LinearLayout>

    </ScrollView>

</LinearLayout>
