<FrameLayout 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"
    tools:context=".ui.modules.login.advanced.LoginAdvancedFragment">

    <com.google.android.material.progressindicator.CircularProgressIndicator
        android:id="@+id/loginFormProgress"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:indeterminate="true"
        android:visibility="gone" />

    <androidx.core.widget.NestedScrollView
        android:id="@+id/nestedScrollView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/loginFormContainer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/loginFormHeader"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="32dp"
                android:layout_marginLeft="32dp"
                android:layout_marginTop="32dp"
                android:layout_marginEnd="32dp"
                android:layout_marginRight="32dp"
                android:gravity="center_horizontal"
                android:text="@string/login_header_default"
                android:textSize="16sp"
                app:fontFamily="sans-serif-light"
                app:layout_constraintBottom_toTopOf="@+id/loginTypeSwitch"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintVertical_chainStyle="packed" />

            <RadioGroup
                android:id="@+id/loginTypeSwitch"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:gravity="center"
                android:orientation="horizontal"
                android:paddingTop="24dp"
                app:layout_constraintBottom_toTopOf="@+id/loginFormAdvancedWarningInfo"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/loginFormHeader">

                <RadioButton
                    android:id="@+id/loginTypeApi"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:tag="api"
                    android:text="@string/login_type_api" />

                <RadioButton
                    android:id="@+id/loginTypeScrapper"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:checked="true"
                    android:tag="scrapper"
                    android:text="@string/login_type_scrapper" />

                <RadioButton
                    android:id="@+id/loginTypeHybrid"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:tag="hybrid"
                    android:text="@string/login_type_hybrid" />
            </RadioGroup>

            <TextView
                android:id="@+id/loginFormAdvancedWarningInfo"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="24dp"
                android:layout_marginTop="12dp"
                android:layout_marginRight="24dp"
                android:gravity="center_horizontal"
                android:lineSpacingExtra="3sp"
                android:text="@string/login_advanced_warning_scraper"
                android:textColor="?colorTimetableChange"
                app:layout_constraintBottom_toTopOf="@id/loginFormUsernameLayout"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toBottomOf="@id/loginTypeSwitch" />

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/loginFormUsernameLayout"
                style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="24dp"
                android:layout_marginLeft="24dp"
                android:layout_marginTop="24dp"
                android:layout_marginEnd="24dp"
                android:layout_marginRight="24dp"
                android:hint="@string/login_nickname_hint"
                app:errorEnabled="true"
                app:layout_constraintBottom_toTopOf="@+id/loginFormPassLayout"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/loginFormAdvancedWarningInfo">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/loginFormUsername"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:autofillHints="username|emailAddress"
                    android:importantForAutofill="yes"
                    android:inputType="textEmailAddress"
                    android:maxLines="1"
                    tools:targetApi="o" />

                <requestFocus />
            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/loginFormPassLayout"
                style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="24dp"
                android:layout_marginLeft="24dp"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="24dp"
                android:layout_marginRight="24dp"
                android:hint="@string/login_password_hint"
                app:errorEnabled="true"
                app:errorIconDrawable="@null"
                app:layout_constraintBottom_toTopOf="@+id/loginFormHostLayout"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/loginFormUsernameLayout"
                app:passwordToggleEnabled="true">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/loginFormPass"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:autofillHints="password"
                    android:imeActionLabel="@string/login_sign_in"
                    android:imeOptions="actionDone"
                    android:importantForAutofill="yes"
                    android:inputType="textPassword"
                    android:maxLines="1"
                    app:fontFamily="sans-serif"
                    tools:targetApi="o" />

            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/loginFormHostLayout"
                style="@style/Widget.Material3.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="24dp"
                android:layout_marginLeft="24dp"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="24dp"
                android:layout_marginRight="24dp"
                android:layout_marginBottom="16dp"
                android:hint="@string/login_host_hint"
                android:orientation="vertical"
                app:layout_constraintBottom_toTopOf="@+id/loginFormDomainSuffixLayout"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/loginFormPassLayout">

                <AutoCompleteTextView
                    android:id="@+id/loginFormHost"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:editable="false"
                    tools:ignore="Deprecated,LabelFor" />
            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/loginFormDomainSuffixLayout"
                style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="24dp"
                android:layout_marginLeft="24dp"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="24dp"
                android:layout_marginRight="24dp"
                android:hint="@string/login_domain_suffix_hint"
                app:errorEnabled="true"
                app:layout_constraintBottom_toTopOf="@+id/loginFormSymbolLayout"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/loginFormHostLayout">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/loginFormDomainSuffix"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textShortMessage"
                    android:maxLines="1" />
            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/loginFormTokenLayout"
                style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="24dp"
                android:layout_marginLeft="24dp"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="24dp"
                android:layout_marginRight="24dp"
                android:hint="@string/login_token_hint"
                app:errorEnabled="true"
                app:layout_constraintBottom_toTopOf="@+id/loginFormSymbolLayout"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/loginFormDomainSuffixLayout">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/loginFormToken"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textCapCharacters"
                    android:maxLines="1" />
            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/loginFormSymbolLayout"
                style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="24dp"
                android:layout_marginLeft="24dp"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="24dp"
                android:layout_marginRight="24dp"
                android:hint="@string/login_symbol_hint"
                app:errorEnabled="true"
                app:layout_constraintBottom_toTopOf="@+id/loginFormPinLayout"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/loginFormTokenLayout">

                <AutoCompleteTextView
                    android:id="@+id/loginFormSymbol"
                    style="@style/Widget.Material3.TextInputEditText.OutlinedBox"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:imeActionLabel="@string/login_sign_in"
                    android:imeOptions="actionDone"
                    android:importantForAutofill="no"
                    android:inputType="textAutoComplete|textNoSuggestions"
                    android:maxLines="1"
                    tools:ignore="LabelFor" />
            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/loginFormPinLayout"
                style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="24dp"
                android:layout_marginLeft="24dp"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="24dp"
                android:layout_marginRight="24dp"
                android:hint="@string/login_pin_hint"
                app:errorEnabled="true"
                app:layout_constraintBottom_toTopOf="@id/loginFormSignIn"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/loginFormSymbolLayout">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/loginFormPin"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:imeActionLabel="@string/login_sign_in"
                    android:imeOptions="actionDone"
                    android:inputType="number"
                    android:maxLines="1" />
            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.button.MaterialButton
                android:id="@+id/loginFormSignIn"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="24dp"
                android:layout_marginRight="24dp"
                android:layout_marginBottom="16dp"
                android:text="@string/login_sign_in"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/loginFormPinLayout" />

        </androidx.constraintlayout.widget.ConstraintLayout>
    </androidx.core.widget.NestedScrollView>
</FrameLayout>
