<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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/scroll"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="12dp"
    android:scrollbarStyle="outsideOverlay"
    tools:context="eu.faircode.email.ActivitySetup">

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

        <!-- provider -->

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvProvider"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/title_provider"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <Spinner
            android:id="@+id/spProvider"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvProvider" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvGmailHint"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="6dp"
            android:text="@string/title_account_gmail"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textStyle="italic"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/spProvider" />

        <!-- auto config -->

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvDomain"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_domain"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvGmailHint" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvDomainHint"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="6dp"
            android:text="@string/title_optional"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textStyle="italic"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvDomain" />

        <EditText
            android:id="@+id/etDomain"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="domain.tld"
            android:inputType="textUri"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvDomainHint" />

        <Button
            android:id="@+id/btnAutoConfig"
            style="@style/buttonStyleSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:minWidth="0dp"
            android:minHeight="0dp"
            android:tag="disable"
            android:text="@string/title_autoconfig"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/etDomain" />

        <eu.faircode.email.ContentLoadingProgressBar
            android:id="@+id/pbAutoConfig"
            style="@style/Base.Widget.AppCompat.ProgressBar"
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_marginStart="12dp"
            android:indeterminate="true"
            app:layout_constraintBottom_toBottomOf="@id/btnAutoConfig"
            app:layout_constraintStart_toEndOf="@id/btnAutoConfig"
            app:layout_constraintTop_toTopOf="@id/btnAutoConfig" />

        <!-- IMAP/POP3 -->

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvImap"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_imap"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/btnAutoConfig" />

        <!-- host -->

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvHost"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_host"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvImap" />

        <EditText
            android:id="@+id/etHost"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="imap.domain.tld"
            android:inputType="textUri"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvHost" />

        <!-- SSL/STARTTLS -->

        <RadioGroup
            android:id="@+id/rgEncryption"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:orientation="horizontal"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/etHost">

            <RadioButton
                android:id="@+id/radio_ssl"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/title_ssl" />

            <RadioButton
                android:id="@+id/radio_starttls"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="12dp"
                android:text="@string/title_starttls" />
        </RadioGroup>

        <CheckBox
            android:id="@+id/cbInsecure"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_allow_insecure"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/rgEncryption" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvInsecureRemark"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="6dp"
            android:text="@string/title_insecure_remark"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textStyle="italic"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbInsecure" />

        <!-- port -->

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvPort"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_port"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvInsecureRemark" />

        <EditText
            android:id="@+id/etPort"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="993"
            android:inputType="number"
            android:maxLength="5"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvPort" />

        <!-- user -->

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvUser"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:labelFor="@+id/etUser"
            android:text="@string/title_user"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/etPort" />

        <EditText
            android:id="@+id/etUser"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:autofillHints="username"
            android:inputType="text"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvUser" />

        <!-- password -->

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvPassword"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_password"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/etUser" />

        <com.google.android.material.textfield.TextInputLayout
            android:id="@+id/tilPassword"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvPassword"
            app:passwordToggleEnabled="true">

            <com.google.android.material.textfield.TextInputEditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:autofillHints="password"
                android:inputType="textPassword"
                android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
        </com.google.android.material.textfield.TextInputLayout>

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvCharacters"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:autoLink="web"
            android:text="@string/title_setup_password_chars"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textColor="?attr/colorWarning"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tilPassword" />

        <Button
            android:id="@+id/btnCertificate"
            style="@style/buttonStyleSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:minWidth="0dp"
            android:minHeight="0dp"
            android:tag="disable"
            android:text="@string/title_client_certificate"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvCharacters" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvCertificate"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="12dp"
            android:text="@string/title_optional"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textStyle="italic"
            app:layout_constraintBottom_toBottomOf="@+id/btnCertificate"
            app:layout_constraintStart_toEndOf="@id/btnCertificate"
            app:layout_constraintTop_toTopOf="@id/btnCertificate" />

        <Button
            android:id="@+id/btnOAuth"
            style="@style/buttonStyleSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:minWidth="0dp"
            android:minHeight="0dp"
            android:tag="disable"
            android:text="@string/title_setup_authentication"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toBottomOf="@id/btnCertificate" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvOAuthSupport"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="6dp"
            android:drawableEnd="@drawable/baseline_open_in_new_24"
            android:drawablePadding="6dp"
            android:text="@string/title_oauth_support"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textColor="?android:attr/textColorLink"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/btnOAuth" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvRealm"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_realm"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvOAuthSupport" />

        <EditText
            android:id="@+id/etRealm"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="@string/title_optional"
            android:inputType="text"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvRealm" />

        <!-- name -->

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvName"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_account_name"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/etRealm" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvNameRemark"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="6dp"
            android:text="@string/title_account_name_hint"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textStyle="italic"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvName" />

        <EditText
            android:id="@+id/etName"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="@string/title_optional"
            android:inputType="textCapSentences|textAutoCorrect"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvNameRemark" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvColor"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_color"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/etName" />

        <eu.faircode.email.ViewButtonColor
            android:id="@+id/btnColor"
            style="@style/buttonStyleSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="6dp"
            android:minWidth="0dp"
            android:minHeight="0dp"
            android:tag="disable"
            android:text="@string/title_select"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvColor" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvColorHint"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="6dp"
            android:text="@string/title_identity_color_hint"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textStyle="italic"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/btnColor" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvColorPro"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="6dp"
            android:text="@string/title_pro_feature"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textColor="?android:attr/textColorLink"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvColorHint" />

        <Button
            android:id="@+id/btnAdvanced"
            style="@style/buttonStyleSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:minWidth="0dp"
            android:minHeight="0dp"
            android:text="@string/title_setup_advanced"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvColorPro" />

        <CheckBox
            android:id="@+id/cbSynchronize"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_enabled"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/btnAdvanced" />

        <CheckBox
            android:id="@+id/cbOnDemand"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_account_ondemand"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbSynchronize" />

        <CheckBox
            android:id="@+id/cbPrimary"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_primary_account"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbOnDemand" />

        <CheckBox
            android:id="@+id/cbNotify"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_account_notify"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbPrimary" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvNotifyPro"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="6dp"
            android:text="@string/title_pro_feature"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textColor="?android:attr/textColorLink"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbNotify" />

        <CheckBox
            android:id="@+id/cbBrowse"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_advanced_browse"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvNotifyPro" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvBrowseHint"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/title_advanced_browse_hint"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textStyle="italic"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbBrowse" />

        <CheckBox
            android:id="@+id/cbAutoSeen"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_advanced_expand_read"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvBrowseHint" />

        <!-- keep alive -->

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvInterval"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_keep_alive_interval"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbAutoSeen" />

        <EditText
            android:id="@+id/etInterval"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="number"
            android:maxLength="9"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvInterval" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvIntervalRemark"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/title_account_interval_hint"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textStyle="italic"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/etInterval" />

        <CheckBox
            android:id="@+id/cbPartialFetch"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_partial_fetch"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvIntervalRemark" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvPartialFetchRemark"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/title_account_partial_fetch_hint"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textStyle="italic"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbPartialFetch" />

        <CheckBox
            android:id="@+id/cbIgnoreSize"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_ignore_size"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvPartialFetchRemark" />

        <CheckBox
            android:id="@+id/cbUseDate"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_use_date"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbIgnoreSize" />

        <!-- check -->

        <Button
            android:id="@+id/btnCheck"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:tag="disable"
            android:text="@string/title_check"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbUseDate" />

        <eu.faircode.email.ContentLoadingProgressBar
            android:id="@+id/pbCheck"
            style="@style/Base.Widget.AppCompat.ProgressBar"
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_marginStart="12dp"
            android:indeterminate="true"
            app:layout_constraintBottom_toBottomOf="@id/btnCheck"
            app:layout_constraintStart_toEndOf="@id/btnCheck"
            app:layout_constraintTop_toTopOf="@id/btnCheck" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvIdle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_no_idle"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textColor="?attr/colorWarning"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/btnCheck" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvUtf8"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_no_utf8"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textStyle="italic"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/tvIdle" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvDrafts"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:maxWidth="150dp"
            android:text="@string/title_folder_drafts"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintBottom_toBottomOf="@+id/spDrafts"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@+id/spDrafts" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvSent"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:maxWidth="150dp"
            android:text="@string/title_folder_sent"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintBottom_toBottomOf="@+id/spSent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@+id/spSent" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvArchive"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:maxWidth="150dp"
            android:text="@string/title_folder_all"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintBottom_toBottomOf="@+id/spArchive"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@+id/spArchive" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvTrash"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:maxWidth="150dp"
            android:text="@string/title_folder_trash"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintBottom_toBottomOf="@+id/spTrash"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@+id/spTrash" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvJunk"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:maxWidth="150dp"
            android:text="@string/title_folder_junk"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintBottom_toBottomOf="@+id/spJunk"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@+id/spJunk" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvLeft"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:maxWidth="150dp"
            android:text="@string/title_account_left"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintBottom_toBottomOf="@+id/spLeft"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@+id/spLeft" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvRight"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:maxWidth="150dp"
            android:text="@string/title_account_right"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintBottom_toBottomOf="@+id/spRight"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@+id/spRight" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvMove"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:maxWidth="150dp"
            android:text="@string/title_account_move"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintBottom_toBottomOf="@+id/spMove"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@+id/spMove" />

        <androidx.constraintlayout.widget.Barrier
            android:id="@+id/barrier_folders"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="6dp"
            app:barrierDirection="end"
            app:constraint_referenced_ids="tvDrafts,tvSent,tvArchive,tvTrash,tvJunk,tvLeft,tvRight,tvMove" />

        <Spinner
            android:id="@+id/spDrafts"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="6dp"
            android:layout_marginTop="12dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@id/barrier_folders"
            app:layout_constraintTop_toBottomOf="@id/tvUtf8" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvDraftsRemark"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/title_drafts_required"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textStyle="italic"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/spDrafts" />

        <Spinner
            android:id="@+id/spSent"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="6dp"
            android:layout_marginTop="12dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@id/barrier_folders"
            app:layout_constraintTop_toBottomOf="@id/tvDraftsRemark" />

        <Spinner
            android:id="@+id/spArchive"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="6dp"
            android:layout_marginTop="12dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@id/barrier_folders"
            app:layout_constraintTop_toBottomOf="@id/spSent" />

        <Spinner
            android:id="@+id/spTrash"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="6dp"
            android:layout_marginTop="12dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@id/barrier_folders"
            app:layout_constraintTop_toBottomOf="@id/spArchive" />

        <Spinner
            android:id="@+id/spJunk"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="6dp"
            android:layout_marginTop="12dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@id/barrier_folders"
            app:layout_constraintTop_toBottomOf="@id/spTrash" />

        <View
            android:id="@+id/vSeparatorSwipe"
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:layout_marginTop="12dp"
            android:background="?attr/colorSeparator"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/spJunk" />

        <Spinner
            android:id="@+id/spLeft"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="6dp"
            android:layout_marginTop="12dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@id/barrier_folders"
            app:layout_constraintTop_toBottomOf="@id/vSeparatorSwipe" />

        <Spinner
            android:id="@+id/spRight"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="6dp"
            android:layout_marginTop="12dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@id/barrier_folders"
            app:layout_constraintTop_toBottomOf="@id/spLeft" />

        <View
            android:id="@+id/vSeparatorMove"
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:layout_marginTop="12dp"
            android:background="?attr/colorSeparator"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/spRight" />

        <Spinner
            android:id="@+id/spMove"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="6dp"
            android:layout_marginTop="12dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@id/barrier_folders"
            app:layout_constraintTop_toBottomOf="@id/vSeparatorMove" />

        <!-- save -->

        <Button
            android:id="@+id/btnSave"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:tag="disable"
            android:text="@string/title_save"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/spMove" />

        <eu.faircode.email.ContentLoadingProgressBar
            android:id="@+id/pbSave"
            style="@style/Base.Widget.AppCompat.ProgressBar"
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_marginStart="12dp"
            android:indeterminate="true"
            app:layout_constraintBottom_toBottomOf="@id/btnSave"
            app:layout_constraintStart_toEndOf="@id/btnSave"
            app:layout_constraintTop_toTopOf="@id/btnSave" />

        <CheckBox
            android:id="@+id/cbIdentity"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_related_identity"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/btnSave" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvErrorTitle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_setup_error"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            android:textStyle="bold"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbIdentity" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvError"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:autoLink="web"
            android:text="error message"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            android:textColor="?attr/colorWarning"
            android:textIsSelectable="true"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvErrorTitle" />

        <CheckBox
            android:id="@+id/cbTrust"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_trust"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvError" />

        <Button
            android:id="@+id/btnSupport"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:backgroundTint="?attr/colorInfoBackground"
            android:text="@string/menu_faq"
            android:textColor="?attr/colorInfoForeground"
            android:textStyle="bold"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbTrust" />

        <Button
            android:id="@+id/btnHelp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:backgroundTint="?attr/colorInfoBackground"
            android:text="@string/title_setup_help"
            android:textColor="?attr/colorInfoForeground"
            android:textStyle="bold"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toBottomOf="@id/cbTrust" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvInstructions"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="provider instructions"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/btnHelp" />

        <eu.faircode.email.ContentLoadingProgressBar
            android:id="@+id/pbWait"
            style="@style/Base.Widget.AppCompat.ProgressBar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:indeterminate="true"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <androidx.constraintlayout.widget.Group
            android:id="@+id/grpServer"
            android:layout_width="0dp"
            android:layout_height="0dp"
            app:constraint_referenced_ids="
                tvDomain,tvDomainHint,etDomain,btnAutoConfig,
                tvImap,tvHost,etHost,rgEncryption,cbInsecure,tvInsecureRemark,tvPort,etPort" />

        <androidx.constraintlayout.widget.Group
            android:id="@+id/grpAuthorize"
            android:layout_width="0dp"
            android:layout_height="0dp"
            app:constraint_referenced_ids="
                tvUser,etUser,tvPassword,tilPassword,btnCertificate,tvCertificate,btnOAuth,tvOAuthSupport,tvRealm,etRealm,
                tvName,tvNameRemark,etName,
                tvColor,btnColor,tvColorHint,tvColorPro" />

        <androidx.constraintlayout.widget.Group
            android:id="@+id/grpAdvanced"
            android:layout_width="0dp"
            android:layout_height="0dp"
            app:constraint_referenced_ids="
                cbNotify,tvNotifyPro,
                cbSynchronize,cbOnDemand,cbPrimary,
                cbBrowse,tvBrowseHint,
                cbAutoSeen,
                tvInterval,etInterval,tvIntervalRemark,
                cbPartialFetch,tvPartialFetchRemark,cbIgnoreSize,cbUseDate" />

        <androidx.constraintlayout.widget.Group
            android:id="@+id/grpFolders"
            android:layout_width="0dp"
            android:layout_height="0dp"
            app:constraint_referenced_ids="
                tvDrafts,spDrafts,tvDraftsRemark,
                tvSent,spSent,
                tvArchive,spArchive,
                tvTrash,spTrash,
                tvJunk,spJunk,
                vSeparatorSwipe,tvLeft,spLeft,tvRight,spRight,
                vSeparatorMove,tvMove,spMove" />

        <androidx.constraintlayout.widget.Group
            android:id="@+id/grpError"
            android:layout_width="0dp"
            android:layout_height="0dp"
            app:constraint_referenced_ids="tvErrorTitle,tvError" />
    </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
