<?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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="?android:attr/windowBackground"
    android:fillViewport="true"
    tools:viewBindingIgnore="true">

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

        <androidx.appcompat.widget.Toolbar
            android:id="@+id/kbs_pin_toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_constraintEnd_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:id="@+id/edit_kbs_pin_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginTop="0dp"
            android:layout_marginEnd="24dp"
            android:textAppearance="@style/Signal.Text.HeadlineMedium"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/kbs_pin_toolbar"
            tools:text="@string/CreateKbsPinFragment__create_your_pin" />

        <org.thoughtcrime.securesms.util.views.LearnMoreTextView
            android:id="@+id/edit_kbs_pin_description"
            style="@style/Signal.Text.BodyLarge"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginTop="16dp"
            android:layout_marginEnd="24dp"
            android:minHeight="66dp"
            android:textColor="?attr/signal_text_secondary"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/edit_kbs_pin_title"
            tools:text="@string/CreateKbsPinFragment__pins_can_help_you_restore_your_account" />

        <com.google.android.material.textfield.TextInputLayout
            android:id="@+id/edit_kbs_textinputlayout"
            style="@style/Widget.Signal.TextInputLayout"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginTop="16dp"
            android:layout_marginEnd="24dp"
            android:minWidth="210dp"
            app:errorEnabled="false"
            app:hintEnabled="false"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/edit_kbs_pin_description"
            app:materialThemeOverlay="@style/Signal.ThemeOverlay.TextInputLayout">

            <org.thoughtcrime.securesms.components.NoAutofillEditText
                android:id="@+id/edit_kbs_pin_input"
                style="@style/Widget.MaterialComponents.TextInputEditText.FilledBox"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:imeOptions="actionDone"
                tools:text="1234567890" />
        </com.google.android.material.textfield.TextInputLayout>

        <TextView
            android:id="@+id/edit_kbs_pin_input_label"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp"
            android:gravity="center_horizontal"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/edit_kbs_textinputlayout"
            app:layout_goneMarginTop="65dp"
            tools:text="PIN must be at least 4 digits" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/edit_kbs_pin_keyboard_toggle"
            style="@style/Signal.Widget.Button.Large.Secondary"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            app:icon="@drawable/ic_keyboard_24"
            app:iconGravity="textStart"
            app:iconPadding="8dp"
            app:layout_constraintBottom_toTopOf="@id/edit_kbs_pin_confirm"
            app:layout_constraintTop_toBottomOf="@id/edit_kbs_pin_input_label"
            app:layout_constraintVertical_bias="0.0"
            tools:layout_editor_absoluteX="32dp"
            tools:text="Create Alphanumeric Pin" />

        <org.thoughtcrime.securesms.util.views.CircularProgressMaterialButton
            android:id="@+id/edit_kbs_pin_confirm"
            style="@style/Signal.Widget.Button.Large.Tonal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="24dp"
            android:layout_marginBottom="16dp"
            app:circularProgressMaterialButton__label="@string/BaseKbsPinFragment__next"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="1.0"
            app:layout_constraintStart_toStartOf="parent"
            app:materialThemeOverlay="@style/ThemeOverlay.Signal.CircularProgressIndicator.Tonal" />
    </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>