<?xml version="1.0" encoding="utf-8"?>

<androidx.core.widget.NestedScrollView 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:id="@+id/add_feed_root"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".activities.AddFeedActivity">

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

        <Spinner
            android:id="@+id/add_feed_account_spinner"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            tools:listitem="@layout/account_type_item" />

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/add_feed_main_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:animateLayoutChanges="true"
            android:padding="16dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/add_feed_account_spinner">

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/add_feed_input_layout"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                app:layout_constraintEnd_toStartOf="@id/add_feed_load"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/add_feed_text_input"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:drawableEnd="@drawable/ic_cancel_grey"
                    android:hint="@string/feed_url"
                    android:inputType="text" />

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

            <Button
                android:id="@+id/add_feed_load"
                style="@style/GenericButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="6dp"
                android:layout_marginTop="4dp"
                android:text="@string/load"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toEndOf="@id/add_feed_input_layout"
                app:layout_constraintTop_toTopOf="parent" />

            <ProgressBar
                android:id="@+id/add_feed_loading"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="8dp"
                android:layout_marginTop="8dp"
                android:visibility="gone"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/add_feed_input_layout"
                tools:visibility="gone" />

            <TextView
                android:id="@+id/add_feed_loading_message"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="6dp"
                android:visibility="gone"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/add_feed_input_layout"
                tools:text="No feed found"
                tools:visibility="visible" />

            <TextView
                android:id="@+id/add_feed_results_text_view"
                style="@style/TextAppearance.Design.Hint"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="12dp"
                android:text="@string/results"
                android:visibility="gone"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/add_feed_loading"
                tools:visibility="visible" />

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/add_feed_results"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:visibility="gone"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/add_feed_results_text_view"
                tools:itemCount="2"
                tools:listitem="@layout/add_feed_item"
                tools:visibility="visible" />

        </androidx.constraintlayout.widget.ConstraintLayout>

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:paddingStart="16dp"
            android:paddingEnd="16dp"
            app:layout_constraintTop_toBottomOf="@id/add_feed_main_layout">

            <Button
                android:id="@+id/add_feed_ok"
                style="@style/GenericButton"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:enabled="true"
                android:text="@string/validate"
                android:textColor="@color/generic_button_color_selector"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="0.6"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <ProgressBar
                android:id="@+id/add_feed_insert_progressbar"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:visibility="gone"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/add_feed_ok"
                tools:visibility="gone" />

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/add_feed_inserted_results_recyclerview"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:visibility="gone"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="0.6"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/add_feed_insert_progressbar"
                tools:itemCount="2"
                tools:listitem="@layout/feed_insertion_result"
                tools:visibility="visible" />

        </androidx.constraintlayout.widget.ConstraintLayout>

    </androidx.constraintlayout.widget.ConstraintLayout>

</androidx.core.widget.NestedScrollView>

