<?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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".registration.fragments.EnterSmsCodeFragment">

    <ScrollView
        android:id="@+id/scroll_view"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:fillViewport="true">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            tools:context=".registration.fragments.EnterSmsCodeFragment">

            <Button
                android:id="@+id/wrong_number"
                style="@style/Button.Borderless.Registration"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:maxWidth="150dp"
                android:layout_marginTop="16dp"
                android:layout_toEndOf="@id/call_me_count_down"
                android:text="@string/RegistrationActivity_wrong_number"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="0.5"
                app:layout_constraintStart_toEndOf="@+id/call_me_count_down"
                app:layout_constraintTop_toBottomOf="@+id/code" />

            <Button
                android:id="@+id/no_code"
                style="@style/Button.Borderless.Registration"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:layout_toEndOf="@id/call_me_count_down"
                android:text="@string/RegistrationActivity_contact_signal_support"
                android:visibility="gone"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="0.5"
                app:layout_constraintStart_toEndOf="@+id/call_me_count_down"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/wrong_number"
                tools:visibility="visible" />

            <TextView
                android:id="@+id/verify_header"
                style="@style/Signal.Text.Headline.Registration"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginStart="32dp"
                android:layout_marginTop="40dp"
                android:layout_marginEnd="32dp"
                android:gravity="center"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="0.5"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                tools:text="@string/RegistrationActivity_enter_the_code_we_sent_to_s" />

            <org.thoughtcrime.securesms.components.registration.CallMeCountDownView
                android:id="@+id/call_me_count_down"
                style="@style/Button.Borderless.Registration"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/code"
                android:maxWidth="150dp"
                app:layout_constraintEnd_toStartOf="@+id/wrong_number"
                app:layout_constraintHorizontal_bias="0.5"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="@+id/wrong_number"
                tools:text="@string/RegistrationActivity_call" />

            <org.thoughtcrime.securesms.components.registration.VerificationCodeView
                android:id="@+id/code"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:layout_centerHorizontal="true"
                android:layout_marginTop="32dp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="0.5"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/verify_header" />

            <LinearLayout
                android:id="@+id/cell_service_warning"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="32dp"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="32dp"
                android:alpha="0"
                android:background="@drawable/registration_no_cell_service_warning_border"
                android:gravity="center"
                android:paddingStart="8dp"
                android:paddingTop="4dp"
                android:paddingEnd="8dp"
                android:paddingBottom="4dp"
                android:text="@string/RegistrationActivity_make_sure_your_phone_has_a_cellular_signal"
                android:visibility="gone"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="0.5"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/no_code"
                tools:alpha="1"
                tools:visibility="visible">

                <androidx.appcompat.widget.AppCompatImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="top"
                    android:layout_margin="2dp"
                    android:importantForAccessibility="no"
                    app:tint="@color/core_ultramarine"
                    app:srcCompat="@drawable/ic_error_outline_14" />

                <TextView
                    style="@style/Signal.Text.Body.Registration"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/RegistrationActivity_make_sure_your_phone_has_a_cellular_signal"
                    android:textAlignment="center"
                    android:textColor="@color/core_ultramarine"
                    android:textSize="12sp" />

            </LinearLayout>

        </androidx.constraintlayout.widget.ConstraintLayout>

    </ScrollView>

    <org.thoughtcrime.securesms.components.registration.VerificationPinKeyboard
        android:id="@+id/keyboard"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

</LinearLayout>