<?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"
        android:id="@+id/rootLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="?android:attr/windowBackground"
        android:scrollbars="none">
        <androidx.constraintlayout.widget.ConstraintLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="16dp"
            android:animateLayoutChanges="true">

            <ImageView
                android:id="@+id/iconImageView"
                android:layout_width="256dp"
                android:layout_height="64dp"
                android:src="@drawable/ic_regist_console"
                android:layout_marginLeft="16dp"
                android:layout_marginRight="16dp"
                android:tint="?attr/colorOnPrimary"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintRight_toRightOf="parent"
                android:layout_marginTop="16dp"/>

            <com.google.android.material.textview.MaterialTextView
                android:id="@+id/titleTextView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/title_regist"
                android:textSize="32sp"
                android:gravity="center"
                android:layout_marginTop="16dp"
                app:layout_constraintTop_toBottomOf="@id/iconImageView"
                android:textAppearance="?attr/textAppearanceHeadline1"/>

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/hostTextInputLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/hint_regist_host"
                app:startIconDrawable="@drawable/ic_host"
                app:layout_constraintTop_toBottomOf="@id/titleTextView"
                android:layout_marginTop="32dp">
                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/hostEditText"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textNoSuggestions|textVisiblePassword"
                    android:maxLines="1"/>
            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.checkbox.MaterialCheckBox
                android:id="@+id/broadcastCheckBox"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:layout_constraintTop_toBottomOf="@id/hostTextInputLayout"
                app:layout_constraintStart_toStartOf="parent"
                android:text="@string/regist_broadcast"/>

            <RadioGroup
                android:id="@+id/ps4VersionRadioGroup"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                app:layout_constraintTop_toBottomOf="@id/broadcastCheckBox">

                <com.google.android.material.radiobutton.MaterialRadioButton
                    android:id="@+id/ps5RadioButton"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/regist_option_ps5"
                    android:layout_weight="1"
                    android:checked="true"/>

                <com.google.android.material.radiobutton.MaterialRadioButton
                    android:id="@+id/ps4VersionGE8RadioButton"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/regist_option_ps4_ge_8"
                    android:layout_weight="1"
                    android:checked="true"/>

                <com.google.android.material.radiobutton.MaterialRadioButton
                    android:id="@+id/ps4VersionGE7RadioButton"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:checked="false"
                    android:text="@string/regist_option_ps4_ge_7" />

                <com.google.android.material.radiobutton.MaterialRadioButton
                    android:id="@+id/ps4VersionLT7RadioButton"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/regist_option_ps4_lt_7"
                        android:layout_weight="1"/>
            </RadioGroup>

            <com.google.android.material.textview.MaterialTextView
                android:id="@+id/psnAccountIdHelpTextView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_constraintTop_toBottomOf="@id/ps4VersionRadioGroup"
                android:text="@string/regist_psn_account_id_help"
                android:gravity="center_horizontal"
                android:textAppearance="?attr/textAppearanceBody1"
                android:alpha="0.6"
                android:layout_marginTop="8dp"/>

            <com.google.android.material.textview.MaterialTextView
                android:id="@+id/psnAccountIdHelpURLTextView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_constraintTop_toBottomOf="@id/psnAccountIdHelpTextView"
                android:text="@string/regist_psn_account_id_help_url"
                android:textSize="12sp"
                android:gravity="center_horizontal"
                android:autoLink="web"
                android:textAppearance="?attr/textAppearanceBody1"/>

            <androidx.constraintlayout.widget.Group
                android:id="@+id/psnAccountIdHelpGroup"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="visible"
                app:constraint_referenced_ids="psnAccountIdHelpTextView,psnAccountIdHelpURLTextView"/>

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/psnIdTextInputLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/hint_regist_psn_online_id"
                app:startIconDrawable="@drawable/ic_psn_id"
                app:layout_constraintTop_toBottomOf="@id/psnAccountIdHelpURLTextView"
                android:layout_marginTop="16dp">
                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/psnIdEditText"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textNoSuggestions|textVisiblePassword"
                    android:maxLines="1"/>
            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.textview.MaterialTextView
                android:id="@+id/pinHelpBeforeTextView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="@string/regist_pin_instructions_ps4_before"
                app:layout_constraintTop_toBottomOf="@id/psnIdTextInputLayout"
                android:textAppearance="?attr/textAppearanceBody1"
                android:layout_marginTop="32dp"
                android:alpha="0.6"/>

            <com.google.android.material.textview.MaterialTextView
                android:id="@+id/pinHelpNavigationTextView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="@string/regist_pin_instructions_ps4_navigation"
                app:layout_constraintTop_toBottomOf="@id/pinHelpBeforeTextView"
                android:textAppearance="?attr/textAppearanceBody1"
                android:textStyle="bold"/>

            <com.google.android.material.textview.MaterialTextView
                android:id="@+id/pinHelpAfterTextView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="@string/regist_pin_instructions_after"
                app:layout_constraintTop_toBottomOf="@id/pinHelpNavigationTextView"
                android:textAppearance="?attr/textAppearanceBody1"
                android:alpha="0.6"/>

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/pinTextInputLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/hint_regist_pin"
                app:startIconDrawable="@drawable/ic_pin"
                app:layout_constraintTop_toBottomOf="@id/pinHelpAfterTextView"
                android:layout_marginTop="16dp">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/pinEditText"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="number"
                    android:maxLength="8"/>
            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.button.MaterialButton
                android:id="@+id/registButton"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_constraintTop_toBottomOf="@id/pinTextInputLayout"
                style="@style/MageTheme.Button"
                android:text="@string/action_regist"
                android:layout_marginTop="32dp" />

        </androidx.constraintlayout.widget.ConstraintLayout>
    </ScrollView>
