<?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/>.
-->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/file_container"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:background="?attr/colorSurface"
    android:paddingBottom="8dp"
    tools:targetApi="lollipop">

    <ViewSwitcher
        android:id="@+id/file_main_switcher"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="@dimen/card_view_margin_horizontal"
        android:minHeight="48dp">
        <com.google.android.material.card.MaterialCardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            style="@style/KeepassDXStyle.Cardview.SurfaceContainer.Small">
            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/file_container_basic_info"
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="?android:attr/selectableItemBackground"
                app:layout_constraintTop_toTopOf="parent">
                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/file_alias"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_centerVertical="true"
                    android:gravity="center_vertical"
                    android:layout_marginStart="@dimen/default_margin"
                    android:layout_marginLeft="@dimen/default_margin"
                    android:layout_marginEnd="@dimen/default_margin"
                    android:layout_marginRight="@dimen/default_margin"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintEnd_toStartOf="@+id/default_file_button"
                    style="@style/KeepassDXStyle.Text.Large.OnSurface"
                    tools:text="DatabaseAlias" />
                <androidx.appcompat.widget.AppCompatCheckBox
                    android:id="@+id/default_file_button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toStartOf="@+id/file_information_button"
                    android:button="@drawable/checkbox_star"
                    android:buttonTint="?attr/colorOnSurface"
                    app:buttonTint="?attr/colorOnSurface"
                    android:gravity="center"
                    android:contentDescription="@string/default_checkbox" />
                <androidx.appcompat.widget.AppCompatImageButton
                    android:id="@+id/file_information_button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerVertical="true"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    android:src="@drawable/ic_arrow_down_white_24dp"
                    android:contentDescription="@string/content_description_file_information"
                    style="@style/KeepassDXStyle.ImageButton.OnSurface"/>
            </androidx.constraintlayout.widget.ConstraintLayout>
        </com.google.android.material.card.MaterialCardView>

        <com.google.android.material.card.MaterialCardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            style="@style/KeepassDXStyle.Cardview.Surface"
            android:layout_marginHorizontal="@dimen/card_view_margin_horizontal">
            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/file_container_alias_register"
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layout_constraintTop_toTopOf="parent">
                <androidx.appcompat.widget.AppCompatEditText
                    android:id="@+id/file_alias_edit"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:minHeight="48dp"
                    android:layout_centerVertical="true"
                    android:maxLines="2"
                    android:gravity="center_vertical"
                    android:layout_marginStart="24dp"
                    android:layout_marginEnd="24dp"
                    android:layout_marginLeft="24dp"
                    android:layout_marginRight="24dp"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintEnd_toStartOf="@+id/file_alias_save"
                    tools:text="DatabaseAlias" />
                <androidx.appcompat.widget.AppCompatImageButton
                    android:id="@+id/file_alias_save"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:padding="12dp"
                    android:layout_centerVertical="true"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintStart_toEndOf="@+id/file_alias_edit"
                    app:layout_constraintEnd_toEndOf="parent"
                    android:src="@drawable/ic_save_white_24dp"
                    android:contentDescription="@string/content_description_file_information"
                    style="@style/KeepassDXStyle.ImageButton.OnSurface"/>
            </androidx.constraintlayout.widget.ConstraintLayout>
        </com.google.android.material.card.MaterialCardView>
    </ViewSwitcher>

    <FrameLayout
        android:id="@+id/file_expand_container"
        android:layout_width="match_parent"
        android:layout_height="@dimen/item_file_info_height">
        <com.google.android.material.card.MaterialCardView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            style="@style/KeepassDXStyle.Cardview.SurfaceContainer.High"
            android:layout_marginHorizontal="@dimen/card_view_margin_horizontal">
            <androidx.constraintlayout.widget.ConstraintLayout
                android:orientation="vertical"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

                <androidx.appcompat.widget.AppCompatImageButton
                    android:id="@+id/file_modify_button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@drawable/ic_mode_edit_white_24dp"
                    android:scaleX="-1"
                    android:scaleY="-1"
                    android:contentDescription="@string/content_description_update_from_list"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:tint="?attr/colorOnSurface"
                    style="@style/KeepassDXStyle.ImageButton.OnSurface"/>

                <LinearLayout
                    android:id="@+id/file_modification_container"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:gravity="start|center_vertical"
                    android:orientation="vertical"
                    android:paddingTop="8dp"
                    android:layout_marginLeft="@dimen/default_margin"
                    android:layout_marginStart="@dimen/default_margin"
                    android:layout_marginRight="@dimen/default_margin"
                    android:layout_marginEnd="@dimen/default_margin"
                    app:layout_constraintEnd_toStartOf="@+id/file_size"
                    app:layout_constraintStart_toEndOf="@+id/file_modify_button"
                    app:layout_constraintTop_toTopOf="parent">

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/file_modification_label"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/entry_modified"
                        android:textColor="?attr/colorOnSurface"
                        android:textSize="12sp" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/file_modification"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        tools:text="Aug 21, 2020 3:40:14 PM"
                        android:textColor="?attr/colorOnSurface" />
                </LinearLayout>

                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/file_size"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:gravity="end|center_vertical"
                    android:paddingTop="8dp"
                    android:layout_marginRight="@dimen/default_margin"
                    android:layout_marginEnd="@dimen/default_margin"
                    app:layout_constraintBottom_toBottomOf="@+id/file_modification_container"
                    app:layout_constraintEnd_toEndOf="parent"
                    tools:text="8 bytes"
                    android:textColor="?attr/colorOnSurface" />

                <androidx.appcompat.widget.AppCompatImageView
                    android:id="@+id/file_delete_button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:contentDescription="@string/content_description_remove_from_list"
                    android:src="@drawable/ic_content_delete_white_24dp"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:tint="?attr/colorOnSurface"
                    style="@style/KeepassDXStyle.ImageButton.OnSurface"/>

                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/file_path"
                    android:textIsSelectable="true"
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:paddingStart="12dp"
                    android:paddingEnd="12dp"
                    android:paddingLeft="12dp"
                    android:paddingRight="12dp"
                    app:layout_constraintTop_toBottomOf="@+id/file_modification_container"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintStart_toEndOf="@+id/file_delete_button"
                    app:layout_constraintEnd_toEndOf="parent"
                    tools:text="/path/to/DatabaseName.kdbx"
                    android:gravity="center_vertical|end"
                    android:textStyle="italic"
                    android:textColor="?attr/colorOnSurface"/>
            </androidx.constraintlayout.widget.ConstraintLayout>
        </com.google.android.material.card.MaterialCardView>
    </FrameLayout>

</LinearLayout>