<?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:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".activities.AddAccountActivity">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/add_account_root"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <ImageView
            android:id="@+id/provider_image"
            android:layout_width="80dp"
            android:layout_height="80dp"
            android:layout_marginTop="60dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            tools:src="@drawable/ic_nextcloud_news" />

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="48dp"
            android:padding="16dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/provider_name">

            <Button
                android:id="@+id/add_account_validate"
                style="@style/GenericButton"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/add_account_password_layout"
                android:layout_marginTop="12dp"
                android:onClick="createAccount"
                android:text="@string/validate" />

            <ProgressBar
                android:id="@+id/add_account_loading"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/add_account_validate"
                android:layout_centerInParent="true"
                android:visibility="gone"
                tools:visibility="visible" />

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/add_account_login_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/add_account_name_layout"
                android:layout_marginTop="12dp"
                android:hint="@string/login">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/add_account_login"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="text" />
            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/add_account_password_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/add_account_login_layout"
                android:layout_marginTop="12dp"
                android:hint="@string/password"
                app:passwordToggleEnabled="true"
                app:passwordToggleTintMode="src_atop">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/add_account_password"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textPassword" />
            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/add_account_url_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/account_url">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/add_account_url"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="text" />
            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/add_account_name_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/add_account_url_layout"
                android:layout_marginTop="12dp"
                android:hint="@string/account_name">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/add_account_name"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="text" />
            </com.google.android.material.textfield.TextInputLayout>

        </RelativeLayout>

        <TextView
            android:id="@+id/provider_name"
            style="@style/TextAppearance.AppCompat.Large"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/provider_image"
            tools:text="@string/nextcloud_news" />

    </androidx.constraintlayout.widget.ConstraintLayout>

</androidx.core.widget.NestedScrollView>


