<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="bou.amine.apps.readerforselfossv2.android.AddSourceActivity">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <com.google.android.material.appbar.AppBarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <androidx.appcompat.widget.Toolbar app:popupTheme="?attr/toolbarPopupTheme" android:theme="@style/ToolBarStyle"
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"

                 />

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



        <androidx.constraintlayout.widget.ConstraintLayout
            android:paddingBottom="@dimen/activity_vertical_margin"
            android:paddingLeft="@dimen/activity_horizontal_margin"
            android:paddingRight="@dimen/activity_horizontal_margin"
            android:paddingTop="@dimen/activity_vertical_margin"
            android:layout_height="match_parent"
            android:layout_width="match_parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintBottom_toBottomOf="parent"
            android:id="@+id/formContainer"
            android:visibility="gone"
            app:layout_constraintHorizontal_bias="1.0"
            app:layout_constraintVertical_bias="0.0">

            <TextView
                android:text="@string/add_source"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/textView2"
                android:textAppearance="@style/TextAppearance.AppCompat.Large"
                android:textAlignment="center"
                android:layout_marginTop="16dp"
                app:layout_constraintTop_toTopOf="parent"
                android:layout_marginEnd="16dp"
                app:layout_constraintRight_toRightOf="parent"
                android:layout_marginRight="16dp"
                android:layout_marginStart="16dp"
                app:layout_constraintLeft_toLeftOf="parent"
                android:layout_marginLeft="16dp"
                android:gravity="center_horizontal" />

            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:ems="10"
                android:id="@+id/nameInput"
                android:layout_marginTop="32dp"
                app:layout_constraintTop_toBottomOf="@+id/textView2"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintRight_toRightOf="parent"
                android:inputType="text"
                android:hint="@string/add_source_hint_name"
                android:textColorHint="?android:textColorPrimary"
                android:autofillHints="false" />

            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:inputType="textUri"
                android:ems="10"
                android:id="@+id/sourceUri"
                android:hint="@string/add_source_hint_url"
                android:textColorHint="?android:textColorPrimary"
                android:layout_marginTop="16dp"
                app:layout_constraintTop_toBottomOf="@+id/nameInput"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintLeft_toLeftOf="parent"
                android:autofillHints="false" />

            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:ems="10"
                android:id="@+id/tags"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintLeft_toLeftOf="parent"
                android:layout_marginTop="16dp"
                app:layout_constraintTop_toBottomOf="@+id/sourceUri"
                android:hint="@string/add_source_hint_tags"
                android:textColorHint="?android:textColorPrimary"
                android:inputType="text"
                android:autofillHints="false" />

            <Spinner
                android:layout_width="match_parent"
                android:id="@+id/spoutsSpinner"
                android:layout_marginTop="16dp"
                app:layout_constraintTop_toBottomOf="@+id/tags"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintLeft_toLeftOf="parent"
                android:layout_height="40dp"/>

            <Button
                android:text="@string/add_source_save"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/saveBtn"
                android:elevation="5dp"
                android:textColor="?android:textColorPrimary"
                android:layout_marginEnd="16dp"
                app:layout_constraintRight_toRightOf="parent"
                android:layout_marginRight="16dp"
                android:layout_marginStart="16dp"
                app:layout_constraintLeft_toLeftOf="parent"
                android:layout_marginLeft="16dp"
                android:layout_marginTop="16dp"
                app:layout_constraintTop_toBottomOf="@+id/spoutsSpinner"
                app:layout_constraintBottom_toBottomOf="parent"
                android:layout_marginBottom="16dp"
                app:layout_constraintVertical_bias="0.0"/>

        </androidx.constraintlayout.widget.ConstraintLayout>

        <ProgressBar
            android:id="@+id/progress"
            style="?android:attr/progressBarStyleLarge"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:visibility="visible"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            tools:visibility="gone" />

    </LinearLayout>
</ScrollView>