<?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_height="match_parent"
    android:layout_width="match_parent">

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

    <ScrollView
        android:layout_width="wrap_content"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:padding="6dip"
        android:fadingEdge="none"
        android:scrollbarStyle="outsideInset" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal|center_vertical"
            android:orientation="vertical" >

            <com.google.android.material.textfield.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/account_email"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/account_setup_basics_email_hint"
                    android:singleLine="true"
                    android:inputType="textEmailAddress"/>
            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.textfield.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:passwordToggleEnabled="true">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/account_password"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/account_setup_basics_password_hint"
                    android:singleLine="true"
                    android:inputType="textPassword"
                    android:nextFocusDown="@+id/next"/>
            </com.google.android.material.textfield.TextInputLayout>
        <LinearLayout
            android:id="@+id/account_allow_client_certificate"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:visibility="gone"
            tools:visibility="visible">

            <TextView
                android:text="@string/account_setup_incoming_client_certificate_label"
                android:layout_height="wrap_content"
                android:layout_width="match_parent"
                style="@style/InputLabel"
                android:layout_marginTop="6dp"/>

            <com.fsck.k9.view.ClientCertificateSpinner
                android:id="@+id/account_client_certificate_spinner"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />
        </LinearLayout>

            <com.fsck.k9.view.FoldableLinearLayout
                android:id="@+id/foldable_advanced_options"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                app:foldedLabel="@string/client_certificate_advanced_options"
                app:unFoldedLabel="@string/client_certificate_advanced_options" >

                <CheckBox
                    android:id="@+id/account_client_certificate"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/account_setup_basics_client_certificate" />
            </com.fsck.k9.view.FoldableLinearLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="0dip"
                android:layout_weight="1" />
        </LinearLayout>
    </ScrollView>

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

</LinearLayout>