<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:id="@+id/coordinator_layout_login_activity"
    tools:application="eu.toldi.infinityforlemmy.activities.LoginActivity">

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/appbar_layout_login_activity"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

        <androidx.appcompat.widget.Toolbar
            android:id="@+id/toolbar_login_activity"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:minHeight="?attr/actionBarSize"
            app:popupTheme="@style/AppTheme.PopupOverlay"
            app:navigationIcon="?attr/homeAsUpIndicator" />

    </com.google.android.material.appbar.AppBarLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <TextView
            android:id="@+id/two_fa_infO_text_view_login_activity"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="16dp"
            android:drawablePadding="32dp"
            android:text="@string/login_activity_2fa_prompt"
            android:textSize="?attr/font_default"
            android:fontFamily="?attr/font_family" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_margin="15dp"
            android:orientation="vertical">

            <com.google.android.material.textfield.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="Instance URL">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/instance_url_input"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:hint="@string/instance_url"
                    android:inputType="textUri"
                    android:maxLines="1" />

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

            <TextView
                android:id="@+id/login_instance_hint"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="3dp"
                android:layout_marginRight="3dp"
                android:text="The URL of you prefered Lemmy instance with or without the https:// prefix" />

            <com.google.android.material.textfield.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/username_input"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/afs_md2_popup_margin_end"
                    android:hint="@string/user_username"
                    android:maxLines="1" />

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

            <com.google.android.material.textfield.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/user_password_input"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/user_password"
                    android:maxLength="60"
                    android:maxLines="1"
                    android:password="true" />

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

            <com.google.android.material.textfield.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/user_2fa_token_input"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/user_2fa_token"
                    android:maxLines="1" />
            </com.google.android.material.textfield.TextInputLayout>

            <Button
                android:id="@+id/user_login_button"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/user_login" />

            <ProgressBar
                android:id="@+id/login_progress"
                style="?android:attr/progressBarStyle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:visibility="gone" />

        </LinearLayout>

    </LinearLayout>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
