<?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/>.
-->
<LinearLayout 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:padding="@dimen/default_margin"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:importantForAutofill="noExcludeDescendants"
    tools:targetApi="o">
    <android.support.v7.widget.CardView
        android:id="@+id/card_view_master_password"
        android:layout_margin="4dp"
        android:layout_gravity="center"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:cardCornerRadius="4dp">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/default_margin"
            android:orientation="vertical">

            <android.support.v7.widget.AppCompatCheckBox
                android:id="@+id/password_checkbox"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/password"/>

            <!-- Password Input -->
            <android.support.design.widget.TextInputLayout
                android:id="@+id/password_input_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:passwordToggleEnabled="true"
                app:passwordToggleTint="?attr/colorAccent">
                <android.support.design.widget.TextInputEditText
                    android:id="@+id/pass_password"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textPassword"
                    android:maxLines="1"
                    android:hint="@string/hint_pass"/>
            </android.support.design.widget.TextInputLayout>
            <android.support.design.widget.TextInputLayout
                android:id="@+id/password_repeat_input_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:passwordToggleEnabled="true"
                app:passwordToggleTint="?attr/colorAccent">
                <EditText android:id="@+id/pass_conf_password"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textPassword"
                    android:maxLines="1"
                    android:hint="@string/hint_conf_pass"/>
            </android.support.design.widget.TextInputLayout>

        </LinearLayout>

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

    <android.support.v7.widget.CardView
        android:id="@+id/card_view_key_file"
        android:layout_gravity="center"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="4dp"
        app:cardCornerRadius="4dp">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/default_margin"
            android:orientation="vertical">

            <android.support.v7.widget.AppCompatCheckBox
                android:id="@+id/keyfile_checkox"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/entry_keyfile"/>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <android.support.v7.widget.AppCompatImageView
                    android:id="@+id/browse_button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentEnd="true"
                    android:layout_alignParentRight="true"
                    android:padding="12dp"
                    android:src="@drawable/ic_folder_white_24dp"
                    android:tint="?attr/colorAccentCompat" />

                <android.support.v7.widget.AppCompatEditText
                    android:id="@+id/pass_keyfile"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_toLeftOf="@+id/browse_button"
                    android:layout_toStartOf="@+id/browse_button"
                    android:hint="@string/hint_keyfile"
                    android:maxLines="1"
                    android:singleLine="true"/>
            </RelativeLayout>


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