<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true"
    tools:context=".fragments.AddServerFragment">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <ImageView
            android:id="@+id/image_banner"
            android:layout_width="268dp"
            android:layout_height="75dp"
            android:layout_marginTop="64dp"
            android:contentDescription="@string/jellyfin_banner"
            android:src="@drawable/ic_banner"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <LinearLayout
            android:id="@+id/linearLayout"
            android:layout_width="@dimen/setup_container_width"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/image_banner"
            app:layout_constraintVertical_bias="0.36">

            <TextView
                android:id="@+id/text_add_server"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="24dp"
                android:layout_marginBottom="32dp"
                android:text="@string/add_server"
                android:textAppearance="@style/TextAppearance.Material3.HeadlineMedium"
                android:textColor="?android:textColorPrimary" />

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/servers_recycler_view"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="12dp"
                android:clipToPadding="false"
                android:orientation="horizontal"
                android:paddingHorizontal="12dp"
                android:visibility="gone"
                app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                tools:itemCount="2"
                tools:listitem="@layout/discovered_server_item"
                tools:visibility="visible" />

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/edit_text_server_address_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="24dp"
                android:layout_marginBottom="8dp"
                android:hint="@string/edit_text_server_address_hint"
                app:errorEnabled="true"
                app:startIconDrawable="@drawable/ic_server">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/edit_text_server_address"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:imeOptions="actionGo"
                    android:inputType="textUri"
                    android:singleLine="true" />

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

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="24dp"
                android:layout_marginBottom="12dp">

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

                <ProgressBar
                    android:id="@+id/progress_circular"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:elevation="8dp"
                    android:indeterminateTint="?attr/colorPrimary"
                    android:padding="8dp"
                    android:visibility="invisible" />

            </RelativeLayout>

            <TextView
                android:id="@+id/privacy_policy_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="24dp"
                android:text="@string/privacy_policy_notice" />

        </LinearLayout>

    </androidx.constraintlayout.widget.ConstraintLayout>

</ScrollView>
