<?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"
    tools:viewBindingIgnore="true"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/scroll_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true"
    tools:context=".registration.fragments.EnterPhoneNumberFragment">

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

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

        <FrameLayout
            android:id="@+id/country_spinner_frame"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="32dp"
            android:layout_marginTop="24dp"
            android:layout_marginEnd="32dp"
            android:background="@drawable/labeled_edit_text_background_inactive"

            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.5"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/verify_subheader">

            <Spinner
                android:id="@+id/country_spinner"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:padding="16dp"
                android:textAlignment="viewStart" />

        </FrameLayout>

        <LinearLayout
            android:id="@+id/linearLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="32dp"
            android:layout_marginTop="16dp"
            android:layout_marginEnd="32dp"
            android:layoutDirection="ltr"
            android:orientation="horizontal"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/country_spinner_frame">

            <org.thoughtcrime.securesms.components.LabeledEditText
                android:id="@+id/country_code"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginEnd="12dp"
                android:layout_weight="1"
                app:labeledEditText_background="@color/white"
                app:labeledEditText_textLayout="@layout/country_code_text" />

            <org.thoughtcrime.securesms.components.LabeledEditText
                android:id="@+id/number"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="3"
                app:labeledEditText_background="@color/white"
                app:labeledEditText_label="@string/RegistrationActivity_phone_number_description"
                app:labeledEditText_textLayout="@layout/phone_text" />
        </LinearLayout>

        <TextView
            android:id="@+id/verify_header"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginStart="32dp"
            android:layout_marginEnd="32dp"
            android:gravity="center"
            android:text="@string/RegistrationActivity_enter_your_phone_number_to_get_started"
            android:textAppearance="@style/Signal.Text.HeadlineMedium"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.5"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/toolbar" />

        <TextView
            android:id="@+id/verify_subheader"
            style="@style/Signal.Text.Body.Registration"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="32dp"
            android:layout_marginTop="16dp"
            android:layout_marginEnd="32dp"
            android:gravity="center"
            android:text="@string/RegistrationActivity_you_will_receive_a_verification_code"
            app:layout_constraintTop_toBottomOf="@+id/verify_header"
            tools:layout_editor_absoluteX="0dp" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/cancel_button"
            style="@style/Signal.Widget.Button.Large.Secondary"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:layout_marginBottom="16dp"
            android:text="@android:string/cancel"
            android:textColor="@color/core_grey_60"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.5"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/registerButton"
            app:layout_constraintVertical_bias="0" />

        <org.thoughtcrime.securesms.util.views.CircularProgressMaterialButton
            android:id="@+id/registerButton"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="32dp"
            android:layout_marginTop="16dp"
            android:layout_marginEnd="32dp"
            android:layout_marginBottom="16dp"
            app:materialThemeOverlay="@style/ThemeOverlay.Signal.CircularProgressIndicator.Primary"
            app:circularProgressMaterialButton__label="@string/RegistrationActivity_next"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.5"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/linearLayout"
            app:layout_constraintVertical_bias="0" />

    </androidx.constraintlayout.widget.ConstraintLayout>

</ScrollView>