<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        android:orientation="vertical">

        <com.google.android.material.appbar.AppBarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <com.google.android.material.appbar.MaterialToolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="?attr/actionBarSize" />
        </com.google.android.material.appbar.AppBarLayout>

        <androidx.coordinatorlayout.widget.CoordinatorLayout
            android:id="@+id/coordinator"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <ScrollView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:fillViewport="true">

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <LinearLayout
                        android:id="@+id/instructions"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentTop="true"
                        android:layout_centerHorizontal="true"
                        android:gravity="center_horizontal"
                        android:orientation="vertical"
                        android:padding="16dp">

                        <TextView
                            android:id="@+id/we_have_sent"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/we_have_sent_you_an_sms_to_x"
                            android:textAppearance="?textAppearanceBodyLarge" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/please_enter_pin_below"
                            android:textAppearance="?textAppearanceBodyMedium" />
                    </LinearLayout>

                    <LinearLayout
                        android:id="@+id/pin_box"
                        android:layout_width="230sp"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/instructions"
                        android:layout_centerHorizontal="true">

                        <EditText
                            android:layout_width="35sp"
                            android:layout_height="wrap_content"
                            android:digits="1234567890"
                            android:gravity="center"
                            android:imeOptions="flagNoExtractUi"
                            android:inputType="number"
                            android:maxLength="1"
                            android:textIsSelectable="false"
                            android:textSize="40sp" />

                        <Space
                            android:layout_width="0dp"
                            android:layout_height="0dp"
                            android:layout_weight="1" />

                        <EditText
                            android:layout_width="35sp"
                            android:layout_height="wrap_content"
                            android:digits="1234567890"
                            android:gravity="center"
                            android:imeOptions="flagNoExtractUi"
                            android:inputType="number"
                            android:maxLength="1"
                            android:textIsSelectable="false"
                            android:textSize="40sp" />

                        <Space
                            android:layout_width="0dp"
                            android:layout_height="0dp"
                            android:layout_weight="1" />

                        <EditText
                            android:layout_width="35sp"
                            android:layout_height="wrap_content"
                            android:digits="1234567890"
                            android:gravity="center"
                            android:imeOptions="flagNoExtractUi"
                            android:inputType="number"
                            android:maxLength="1"
                            android:textIsSelectable="false"
                            android:textSize="40sp" />

                        <Space
                            android:layout_width="0dp"
                            android:layout_height="0dp"
                            android:layout_weight="1" />

                        <EditText
                            android:layout_width="35sp"
                            android:layout_height="wrap_content"
                            android:digits="1234567890"
                            android:gravity="center"
                            android:imeOptions="flagNoExtractUi"
                            android:inputType="number"
                            android:maxLength="1"
                            android:textIsSelectable="false"
                            android:textSize="40sp" />

                        <Space
                            android:layout_width="0dp"
                            android:layout_height="0dp"
                            android:layout_weight="1" />

                        <EditText
                            android:layout_width="35sp"
                            android:layout_height="wrap_content"
                            android:digits="1234567890"
                            android:gravity="center"
                            android:imeOptions="flagNoExtractUi"
                            android:inputType="number"
                            android:maxLength="1"
                            android:textIsSelectable="false"
                            android:textSize="40sp" />

                        <Space
                            android:layout_width="0dp"
                            android:layout_height="0dp"
                            android:layout_weight="1" />

                        <EditText
                            android:layout_width="35sp"
                            android:layout_height="wrap_content"
                            android:digits="1234567890"
                            android:gravity="center"
                            android:imeOptions="flagNoExtractUi"
                            android:inputType="number"
                            android:maxLength="1"
                            android:textIsSelectable="false"
                            android:textSize="40sp" />
                    </LinearLayout>

                    <Button
                        android:id="@+id/next"
                        style="@style/Widget.Material3.Button.ElevatedButton"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentEnd="true"
                        android:layout_alignParentBottom="true"
                        android:layout_margin="16dp"
                        android:text="@string/next" />

                    <Button
                        android:id="@+id/back"
                        style="@style/Widget.Material3.Button.TextButton"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentStart="true"
                        android:layout_alignParentBottom="true"
                        android:layout_margin="16dp"
                        android:text="@string/back" />

                    <Button
                        android:id="@+id/resend_sms"
                        style="@style/Widget.Material3.Button.TextButton"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/pin_box"
                        android:layout_centerHorizontal="true"
                        android:text="@string/resend_sms" />

                    <ProgressBar
                        android:id="@+id/progressBar"
                        style="?android:attr/progressBarStyle"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/pin_box"
                        android:layout_centerHorizontal="true" />
                </RelativeLayout>
            </ScrollView>
        </androidx.coordinatorlayout.widget.CoordinatorLayout>
    </LinearLayout>
</layout>
