<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/grey_100"
    android:orientation="vertical"
    android:weightSum="4">

    <ProgressBar
        android:id="@+id/progressBar"
        android:indeterminate="true"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:visibility="invisible"
        style="?android:attr/progressBarStyleHorizontal"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="3"
        android:gravity="center_horizontal"
        android:orientation="vertical">

        <ImageView
            android:id="@+id/icon"
            style="@style/ThemeOverlay.FirebaseIcon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:contentDescription="@string/desc_firebase_lockup"
            android:src="@drawable/firebase_lockup_400" />

        <TextView
            android:id="@+id/titleText"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="@dimen/title_bottom_margin"
            android:text="@string/emailpassword_title_text"
            android:theme="@style/ThemeOverlay.MyTitleText" />

        <TextView
            android:id="@+id/status"
            style="@style/ThemeOverlay.MyTextDetail"
            android:text="@string/signed_out" />

        <TextView
            android:id="@+id/detail"
            style="@style/ThemeOverlay.MyTextDetail"
            tools:text="Firebase User ID: 123456789abc" />
    </LinearLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:background="@color/grey_300"
        android:gravity="center_vertical">

        <LinearLayout
            android:id="@+id/emailPasswordFields"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:paddingLeft="16dp"
            android:paddingRight="16dp">

            <EditText
                android:id="@+id/fieldEmail"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:hint="@string/hint_email"
                android:inputType="textEmailAddress" />

            <EditText
                android:id="@+id/fieldPassword"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:hint="@string/hint_password"
                android:inputType="textPassword" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/emailPasswordButtons"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/emailPasswordFields"
            android:orientation="horizontal"
            android:paddingLeft="16dp"
            android:paddingRight="16dp">

            <Button
                android:id="@+id/emailSignInButton"
                android:layout_marginStart="@dimen/button_horizontal_margin"
                android:layout_marginEnd="@dimen/button_horizontal_margin"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="@string/sign_in"
                android:theme="@style/ThemeOverlay.MyDarkButton" />

            <Button
                android:id="@+id/emailCreateAccountButton"
                android:layout_marginStart="@dimen/button_horizontal_margin"
                android:layout_marginEnd="@dimen/button_horizontal_margin"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="@string/create_account"
                android:theme="@style/ThemeOverlay.MyDarkButton" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/signedInButtons"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:orientation="horizontal"
            android:paddingLeft="16dp"
            android:paddingRight="16dp"
            android:visibility="gone">

            <Button
                android:id="@+id/signOutButton"
                android:layout_marginStart="@dimen/button_horizontal_margin"
                android:layout_marginEnd="@dimen/button_horizontal_margin"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="@string/sign_out"
                android:theme="@style/ThemeOverlay.MyDarkButton" />

            <Button
                android:id="@+id/verifyEmailButton"
                android:layout_marginStart="@dimen/button_horizontal_margin"
                android:layout_marginEnd="@dimen/button_horizontal_margin"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="@string/verify_email"
                android:theme="@style/ThemeOverlay.MyDarkButton" />

            <Button
                android:id="@+id/reloadButton"
                style="@style/Widget.AppCompat.Button.Colored"
                android:layout_marginStart="@dimen/button_horizontal_margin"
                android:layout_marginEnd="@dimen/button_horizontal_margin"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="@string/reload"
                android:theme="@style/ThemeOverlay.MyDarkButton" />
        </LinearLayout>
    </RelativeLayout>
</LinearLayout>
