<?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/>.
-->
<androidx.constraintlayout.widget.ConstraintLayout
    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:importantForAutofill="noExcludeDescendants"
    android:id="@+id/activity_entry_edit_container"
    tools:targetApi="o"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:filterTouchesWhenObscured="true">

    <com.kunzisoft.keepass.view.ToolbarSpecial
        android:id="@+id/special_mode_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toTopOf="parent" />

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:id="@+id/entry_edit_coordinator_layout"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        app:layout_constraintTop_toBottomOf="@+id/special_mode_view"
        app:layout_constraintBottom_toBottomOf="parent">

        <androidx.core.widget.NestedScrollView
            android:id="@+id/entry_edit_scroll"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintBottom_toBottomOf="parent"
            android:scrollbarStyle="insideOverlay"
            android:scrollbars="none"
            app:layout_behavior="@string/appbar_scrolling_view_behavior">
            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:paddingTop="@dimen/card_view_margin_vertical"
                android:paddingBottom="128dp">
                <androidx.appcompat.widget.AppCompatSpinner
                    android:id="@+id/entry_edit_template_selector"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:layout_constraintTop_toTopOf="parent" />
                <androidx.fragment.app.FragmentContainerView
                    android:id="@+id/entry_edit_content"
                    android:name="com.kunzisoft.keepass.activities.fragments.EntryEditFragment"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    app:layout_constraintWidth_percent="@dimen/content_percent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/entry_edit_template_selector"/>
            </androidx.constraintlayout.widget.ConstraintLayout>
        </androidx.core.widget.NestedScrollView>

    </androidx.coordinatorlayout.widget.CoordinatorLayout>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/activity_entry_edit_footer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/bottom_toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintBottom_toTopOf="@+id/screenshot_mode_banner">

            <com.kunzisoft.keepass.view.ToolbarAction
                android:id="@+id/entry_edit_bottom_bar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom"
                app:layout_constraintBottom_toBottomOf="parent" />

            <com.google.android.material.floatingactionbutton.FloatingActionButton
                android:id="@+id/entry_edit_validate"
                style="@style/KeepassDXStyle.Fab"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:contentDescription="@string/validate"
                android:src="@drawable/ic_check_white_24dp"
                app:fabCustomSize="@dimen/button_small_size"
                app:layout_constraintTop_toTopOf="@+id/entry_edit_bottom_bar"
                app:layout_constraintBottom_toBottomOf="@+id/entry_edit_bottom_bar"
                android:layout_marginBottom="6dp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent" />

            <include
                layout="@layout/view_button_lock"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintBottom_toBottomOf="parent"/>

        </androidx.constraintlayout.widget.ConstraintLayout>

        <include
            app:layout_constraintTop_toBottomOf="@+id/bottom_toolbar"
            app:layout_constraintBottom_toBottomOf="parent"
            layout="@layout/view_screenshot_mode_banner" />

    </androidx.constraintlayout.widget.ConstraintLayout>

    <ProgressBar
        android:id="@+id/loading"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:indeterminate="true"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
