<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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/login_fragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="?riotx_background">

    <androidx.core.widget.NestedScrollView style="@style/LoginFormScrollView">

        <LinearLayout style="@style/LoginFormContainer">

            <ImageView
                style="@style/LoginLogo"
                tools:ignore="ContentDescription" />

            <ImageView
                android:id="@+id/loginServerIcon"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:tint="?riotx_text_primary"
                tools:ignore="MissingPrefix"
                tools:src="@drawable/ic_logo_matrix_org" />

            <TextView
                android:id="@+id/loginTitle"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/layout_vertical_margin"
                android:textAppearance="@style/TextAppearance.Vector.Login.Title"
                tools:text="@string/login_signin_to" />

            <TextView
                android:id="@+id/loginNotice"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/layout_vertical_margin"
                android:gravity="start"
                android:textAppearance="@style/TextAppearance.Vector.Login.Text.Small"
                tools:text="@string/login_server_matrix_org_text" />

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/loginFieldTil"
                style="@style/VectorTextInputLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="32dp"
                app:errorEnabled="true"
                tools:hint="@string/login_signin_username_hint">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/loginField"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textEmailAddress"
                    android:maxLines="1" />

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

            <FrameLayout
                android:id="@+id/passwordContainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp">

                <com.google.android.material.textfield.TextInputLayout
                    android:id="@+id/passwordFieldTil"
                    style="@style/VectorTextInputLayout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/login_signup_password_hint"
                    app:errorEnabled="true"
                    app:errorIconDrawable="@null">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/passwordField"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:ems="10"
                        android:imeOptions="actionDone"
                        android:inputType="textPassword"
                        android:maxLines="1"
                        android:paddingEnd="48dp"
                        tools:ignore="RtlSymmetry" />

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

                <ImageView
                    android:id="@+id/passwordReveal"
                    android:layout_width="@dimen/layout_touch_size"
                    android:layout_height="@dimen/layout_touch_size"
                    android:layout_gravity="end"
                    android:layout_marginTop="8dp"
                    android:background="?attr/selectableItemBackground"
                    android:scaleType="center"
                    android:src="@drawable/ic_eye"
                    app:tint="?attr/colorAccent"
                    tools:contentDescription="@string/a11y_show_password"
                    tools:ignore="MissingPrefix" />

            </FrameLayout>

            <TextView
                android:id="@+id/loginPasswordNotice"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="start"
                android:text="@string/login_signin_matrix_id_password_notice"
                android:textAppearance="@style/TextAppearance.Vector.Login.Text.Small"
                android:visibility="gone"
                tools:visibility="visible" />

            <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="22dp">

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/forgetPasswordButton"
                    style="@style/Style.Vector.Login.Button.Text"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="start"
                    android:text="@string/auth_forgot_password" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/loginSubmit"
                    style="@style/Style.Vector.Login.Button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="end"
                    android:text="@string/auth_login"
                    tools:enabled="false"
                    tools:ignore="RelativeOverlap" />

            </FrameLayout>

            <!-- Social Logins buttons -->
            <LinearLayout
                android:id="@+id/loginSocialLoginContainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:orientation="vertical"
                android:visibility="gone"
                tools:visibility="visible">

                <TextView
                    android:id="@+id/loginSocialLoginHeader"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="16dp"
                    android:gravity="center"
                    android:text="@string/login_social_continue"
                    android:textAppearance="@style/TextAppearance.Vector.Login.Text"
                    android:textSize="14sp" />

                <im.vector.app.features.login.SocialLoginButtonsView
                    android:id="@+id/loginSocialLoginButtons"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    tools:signMode="signin" />

            </LinearLayout>

        </LinearLayout>

    </androidx.core.widget.NestedScrollView>

</FrameLayout>

