<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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=".LoginActivity">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:orientation="vertical">

            <ImageView
                android:id="@+id/mascotImage"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="20dp"
                android:contentDescription="@string/mascot_description"
                app:srcCompat="@drawable/mascot" />

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/login_activity_instance_input_layout"
                android:layout_width="250dp"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:hint="@string/domain_of_your_instance"
                android:visibility="gone"
                app:errorEnabled="true"
                tools:visibility="visible">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/editText"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:ems="10"
                    android:imeOptions="actionDone"
                    android:inputType="textUri" />

                <Button
                    android:id="@+id/connect_instance_button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/connect_to_pixelfed" />

                <TextView
                    android:id="@+id/whatsAnInstanceTextView"
                    android:layout_width="250dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:autoLink="web"
                    android:linksClickable="true"
                    android:paddingTop="8dp"
                    android:text="@string/whats_an_instance"
                    android:textAlignment="center" />

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

            <LinearLayout
                android:id="@+id/login_activity_connection_required"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:orientation="vertical"
                android:visibility="gone">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/login_connection_required_once"
                    android:textAlignment="center"/>

                <Button
                    android:id="@+id/login_activity_connection_required_button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="15dp"
                    android:text="@string/retry"/>

            </LinearLayout>


            <LinearLayout
                android:id="@+id/progressLayout"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="center"
                android:orientation="vertical"
                android:visibility="gone">

                <ProgressBar
                    style="?android:attr/progressBarStyle"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />
            </LinearLayout>

        </LinearLayout>
    </ScrollView>

</androidx.constraintlayout.widget.ConstraintLayout>