<?xml version="1.0" encoding="utf-8"?>
<!--
 Copyright 2017 Brian Pellin, Jeremy Jamet / Kunzisoft.
     
 This file is part of KeePass DX.

  KeePass DX is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  KeePass DX is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with KeePass DX.  If not, see <http://www.gnu.org/licenses/>.
-->
<RelativeLayout 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:importantForAutofill="noExcludeDescendants"
    tools:targetApi="o">

    <include
        android:id="@+id/toolbar"
        layout="@layout/toolbar_default" />

	<ScrollView android:id="@+id/entry_scroll"
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
        android:layout_below="@+id/toolbar"
        android:fillViewport="true">
		<LinearLayout
            android:padding="@dimen/default_margin"
            android:orientation="vertical"
            android:layout_width="match_parent"
			android:layout_height="wrap_content">

			<!--  Title -->
            <RelativeLayout
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <android.support.design.widget.TextInputLayout
                    android:layout_width="100dp"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentStart="true"
                    android:layout_toLeftOf="@+id/icon_button"
                    android:layout_toStartOf="@+id/icon_button">

                    <android.support.v7.widget.AppCompatEditText
                        android:id="@+id/entry_title"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="text"
                        android:maxLines="1"
                        android:hint="@string/entry_title" />

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

                <android.support.v7.widget.AppCompatImageButton android:id="@+id/icon_button"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:src="@drawable/ic00"
                    android:layout_margin="8dp"
                    android:layout_alignParentRight="true"
                    android:layout_alignParentEnd="true"/>
            </RelativeLayout>

			<!-- Username -->
            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <android.support.v7.widget.AppCompatEditText
                    android:id="@+id/entry_user_name"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="text"
                    android:maxLines="1"
                    android:hint="@string/entry_user_name" />
            </android.support.design.widget.TextInputLayout>

			<!-- Password -->
            <RelativeLayout
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <android.support.design.widget.TextInputLayout
                    android:id="@+id/container_entry_password"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    app:passwordToggleEnabled="true"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentStart="true"
                    android:layout_toLeftOf="@+id/generate_button"
                    android:layout_toStartOf="@+id/generate_button">

                    <android.support.v7.widget.AppCompatEditText
                        android:id="@+id/entry_password"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="textPassword"
                        android:maxLines="1"
                        android:hint="@string/entry_password" />
                </android.support.design.widget.TextInputLayout>

                <!-- Confirm Password -->
                <android.support.design.widget.TextInputLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentStart="true"
                    app:passwordToggleEnabled="true"
                    android:layout_toLeftOf="@+id/generate_button"
                    android:layout_toStartOf="@+id/generate_button"
                    android:layout_below="@+id/container_entry_password">

                    <android.support.v7.widget.AppCompatEditText
                        android:id="@+id/entry_confpassword"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="textPassword"
                        android:maxLines="1"
                        android:hint="@string/entry_confpassword" />
                </android.support.design.widget.TextInputLayout>

                <android.support.v7.widget.AppCompatImageView
                    android:id="@+id/generate_button"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:layout_alignParentEnd="true"
                    android:layout_alignParentRight="true"
                    android:layout_centerVertical="true"
                    android:layout_margin="8dp"
                    android:src="@drawable/ic_key_white_24dp"
                    android:tint="?attr/colorAccent" />
            </RelativeLayout>

            <!--  URL -->
            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <android.support.v7.widget.AppCompatEditText
                    android:id="@+id/entry_url"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textUri"
                    android:maxLines="1"
                    android:hint="@string/entry_url" />
            </android.support.design.widget.TextInputLayout>

			<!-- Comment -->
            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <android.support.v7.widget.AppCompatEditText
                    android:id="@+id/entry_comment"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="start"
                    android:lines="4"
                    android:maxLines="10"
                    android:inputType="textMultiLine"
                    android:hint="@string/entry_comment" />
            </android.support.design.widget.TextInputLayout>

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

			<ImageView android:id="@+id/add_new_field"
				android:layout_width="30sp"
				android:layout_height="30sp"
				android:contentDescription="@string/add_string"
				android:src="@drawable/ic_add_white_24dp"
                android:tint="?attr/colorAccent"
				android:scaleType="centerCrop"
				android:visibility="gone" />
		</LinearLayout>
	</ScrollView >

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/entry_save"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentEnd="true"
        android:layout_alignParentRight="true"
        android:src="@drawable/ic_save_white_24dp"
        app:useCompatPadding="true"
        style="@style/KeepassDXStyle.Fab"/>
</RelativeLayout>