<?xml version="1.0" encoding="utf-8"?>
<!--
 Copyright 2019 Jeremy Jamet / Kunzisoft.
     
 This file is part of KeePassDX.

  KeePassDX 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.

  KeePassDX 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 KeePassDX.  If not, see <http://www.gnu.org/licenses/>.
-->
<ScrollView 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:filterTouchesWhenObscured="true"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <LinearLayout
        android:padding="@dimen/default_margin"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        tools:targetApi="o">
        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >
            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toStartOf="@+id/credentials_information"
                android:text="@string/assign_master_key"
                style="@style/KeepassDXStyle.Title"/>
            <ImageView
                android:id="@+id/credentials_information"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                android:src="@drawable/ic_info_white_24dp"
                style="@style/KeepassDXStyle.ImageButton.Simple"
                android:contentDescription="@string/content_description_credentials_information"/>
        </androidx.constraintlayout.widget.ConstraintLayout>
        <androidx.cardview.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">

                <com.google.android.material.materialswitch.MaterialSwitch
                    android:id="@+id/password_checkbox"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/password"/>

                <!-- Password Input -->
                <com.kunzisoft.keepass.view.PasswordEditView
                    android:id="@+id/password_view"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:passwordVisible="false"/>
                <com.google.android.material.textfield.TextInputLayout
                    android:id="@+id/password_repeat_input_layout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:importantForAccessibility="no"
                    android:importantForAutofill="no"
                    android:contentDescription="@string/content_description_repeat_toggle_password_visibility"
                    app:endIconMode="password_toggle"
                    app:endIconTint="?attr/colorSecondary">
                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/password_confirmation"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:ems="10"
                        android:importantForAccessibility="no"
                        android:importantForAutofill="no"
                        android:inputType="textPassword|textMultiLine"
                        android:textDirection="ltr"
                        android:maxLines="3"
                        android:hint="@string/hint_conf_pass"/>
                </com.google.android.material.textfield.TextInputLayout>

            </LinearLayout>

        </androidx.cardview.widget.CardView>

        <androidx.cardview.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">

                <com.google.android.material.materialswitch.MaterialSwitch
                    android:id="@+id/keyfile_checkbox"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/entry_keyfile"/>

                <com.google.android.material.button.MaterialButton
                    style="@style/KeepassDXStyle.Button.Secondary"
                    android:id="@+id/keyfile_generate"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="end"
                    app:icon="@drawable/ic_file_key_white_24dp"
                    android:text="@string/generate_keyfile" />

                <com.kunzisoft.keepass.view.KeyFileSelectionView
                    android:id="@+id/keyfile_selection"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintStart_toEndOf="@+id/keyfile_checkbox"
                    app:layout_constraintEnd_toEndOf="parent" />
            </LinearLayout>
        </androidx.cardview.widget.CardView>

        <androidx.cardview.widget.CardView
            android:id="@+id/card_view_hardware_key"
            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">

                <com.google.android.material.materialswitch.MaterialSwitch
                    android:id="@+id/hardware_key_checkbox"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/hardware_key"/>

                <com.kunzisoft.keepass.view.HardwareKeySelectionView
                    android:id="@+id/hardware_key_selection"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintStart_toEndOf="@+id/hardware_key_checkbox"
                    app:layout_constraintEnd_toEndOf="parent"
                    android:importantForAccessibility="no"
                    android:importantForAutofill="no" />
            </LinearLayout>
        </androidx.cardview.widget.CardView>
    </LinearLayout>
</ScrollView>