<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
    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:background="@color/material_indigo_700"
    android:fitsSystemWindows="true"
    android:orientation="vertical"
    app:statusBarBackground="@color/material_indigo_900"
    tools:context=".ui.modules.login.LoginActivity"
    tools:ignore="Overdraw">

    <android.support.v4.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center">

        <android.support.v7.widget.CardView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_margin="@dimen/spacing_s_large"
            android:minHeight="350dp"
            android:minWidth="250dp"
            app:cardElevation="@dimen/spacing_normal">

            <LinearLayout
                android:id="@+id/loginForm"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">


                <com.fastaccess.ui.widgets.FontTextView
                    android:id="@+id/mainCard"
                    style="@style/TextAppearance.AppCompat.Title.Inverse"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:background="?colorAccent"
                    android:gravity="center"
                    android:paddingBottom="@dimen/spacing_large"
                    android:paddingEnd="@dimen/spacing_xs_large"
                    android:paddingStart="@dimen/spacing_xs_large"
                    android:paddingTop="@dimen/spacing_large"
                    android:text="@string/sign_in_to_github"/>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:layout_marginTop="@dimen/spacing_normal"
                    android:gravity="center"
                    android:orientation="vertical"
                    android:paddingBottom="@dimen/spacing_normal"
                    android:paddingEnd="@dimen/spacing_xs_large"
                    android:paddingStart="@dimen/spacing_xs_large"
                    android:paddingTop="@dimen/spacing_normal">

                    <android.support.design.widget.TextInputLayout
                        android:id="@+id/username"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:hint="@string/username">

                        <android.support.design.widget.TextInputEditText
                            android:id="@+id/usernameEditText"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:inputType="text"
                            android:maxLines="1"/>
                    </android.support.design.widget.TextInputLayout>

                    <android.support.design.widget.TextInputLayout
                        android:id="@+id/password"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="@dimen/spacing_xs_large"
                        android:hint="@string/password"
                        app:passwordToggleEnabled="true"
                        app:passwordToggleTint="?colorAccent">

                        <android.support.design.widget.TextInputEditText
                            android:id="@+id/passwordEditText"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:imeOptions="actionSend"
                            android:inputType="textPassword"
                            android:maxLines="1"/>
                    </android.support.design.widget.TextInputLayout>

                    <android.support.design.widget.TextInputLayout
                        android:id="@+id/twoFactor"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="@dimen/spacing_xs_large"
                        android:hint="@string/twoFactor"
                        android:visibility="gone"
                        tools:visibility="visible">

                        <android.support.design.widget.TextInputEditText
                            android:id="@+id/twoFactorEditText"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:imeOptions="actionSend"
                            android:inputType="text"
                            android:maxLines="1"/>
                    </android.support.design.widget.TextInputLayout>

                    <FrameLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content">

                        <android.support.design.widget.FloatingActionButton
                            android:id="@+id/login"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:layout_margin="@dimen/fab_margin"
                            android:src="@drawable/ic_send"
                            android:tint="@color/white"
                            app:fabSize="normal"/>

                        <ProgressBar
                            android:id="@+id/progress"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:layout_margin="@dimen/fab_margin"
                            android:visibility="gone"/>
                    </FrameLayout>

                    <com.fastaccess.ui.widgets.FontTextView
                        style="@style/TextAppearance.AppCompat.Small"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:background="@drawable/bottom_border"
                        android:gravity="center"
                        android:paddingBottom="@dimen/spacing_normal"
                        android:text="@string/or_character"/>

                    <com.fastaccess.ui.widgets.FontTextView
                        style="@style/TextAppearance.AppCompat.Small"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="@dimen/spacing_normal"
                        android:gravity="center"
                        android:text="@string/login_using_your_default_browser"/>

                    <com.fastaccess.ui.widgets.FontButton
                        android:id="@+id/browserLogin"
                        style="@style/Widget.AppCompat.Button.Borderless.Colored"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/open_in_browser"/>

                </LinearLayout>
            </LinearLayout>

        </android.support.v7.widget.CardView>


    </android.support.v4.widget.NestedScrollView>


</android.support.design.widget.CoordinatorLayout>