<?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.FixedTextView
            android:id="@+id/tvGrantHint"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/title_setup_oauth_rationale"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textStyle="italic"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <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_toBottomOf="@id/tvGrantHint">

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

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

        <eu.faircode.email.ContentLoadingProgressBar
            android:id="@+id/pbOAuth"
            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/btnOAuth"
            app:layout_constraintStart_toEndOf="@id/btnOAuth"
            app:layout_constraintTop_toTopOf="@id/btnOAuth" />

        <eu.faircode.email.FixedTextView
            android:id="@+id/tvAuthorized"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="12dp"
            android:drawableStart="@drawable/baseline_check_24"
            android:drawablePadding="6dp"
            android:text="@string/title_setup_done"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            android:textColor="?android:attr/textColorPrimary"
            app:layout_constraintBottom_toBottomOf="@id/btnOAuth"
            app:layout_constraintStart_toEndOf="@id/pbOAuth"
            app:layout_constraintTop_toTopOf="@id/btnOAuth" />

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

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

        <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/tvGmailDraftsHint"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/title_setup_gmail_drafts"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textStyle="italic"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvError" />

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

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

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