<?xml version="1.0" encoding="utf-8"?>
<eu.faircode.email.ScrollViewEx 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">

        <eu.faircode.email.EditTextPlain
            android:id="@+id/etName"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:autofillHints="name"
            android:hint="@string/title_identity_name"
            android:imeOptions="actionNext"
            android:inputType="textPersonName|textCapWords"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <requestFocus />
        </eu.faircode.email.EditTextPlain>

        <eu.faircode.email.EditTextPlain
            android:id="@+id/etEmail"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:autofillHints="emailAddress"
            android:hint="@string/title_identity_email"
            android:imeOptions="actionNext"
            android:inputType="textEmailAddress"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/etName" />

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

            <com.google.android.material.textfield.TextInputEditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:autofillHints="password"
                android:hint="@string/title_setup_password"
                android:imeOptions="actionGo"
                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: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" />

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

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

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

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

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

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvErrorHint"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="6dp"
            android:autoLink="web"
            android:text="Error hint"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textColor="?attr/colorWarning"
            android:textIsSelectable="true"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvError" />

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

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

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

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

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

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvImap"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="imap.domain.tld:993"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            android:textColor="?android:attr/textColorPrimary"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvImapTitle" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvImapFingerprint"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="fingerprint"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textColor="?attr/colorWarning"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvImap" />

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

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvSmtp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="smtp.domain.tld:993"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            android:textColor="?android:attr/textColorPrimary"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvSmtpTitle" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvSmtpFingerprint"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="fingerprint"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textColor="?attr/colorWarning"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvSmtp" />

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

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

        <androidx.constraintlayout.widget.Group
            android:id="@+id/grpSetup"
            android:layout_width="0dp"
            android:layout_height="0dp"
            app:constraint_referenced_ids="
            tvImapTitle,tvImap,tvImapFingerprint,tvSmtpTitle,
            tvSmtp,tvSmtpFingerprint,
            btnSave" />

        <androidx.constraintlayout.widget.Group
            android:id="@+id/grpError"
            android:layout_width="0dp"
            android:layout_height="0dp"
            app:constraint_referenced_ids="tvErrorTitle,tvError,tvErrorHint,tvErrorRemark" />
    </androidx.constraintlayout.widget.ConstraintLayout>
</eu.faircode.email.ScrollViewEx>
