<?xml version="1.0" encoding="utf-8"?>

<layout xmlns:tools="http://schemas.android.com/tools"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:fab="http://schemas.android.com/apk/res-auto">
    <data>

        <import type="android.view.View" />
        <variable
            name="view"
            type="it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormActivity"
            />
        <variable
            name="viewModel"
            type="it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormViewModel" />

    </data>

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">


        <LinearLayout
            android:id="@+id/linearLayout2"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/full_white"
            android:orientation="vertical"
            android:descendantFocusability="blocksDescendants"
            >

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/full_white"
                android:orientation="vertical"
                android:paddingTop="8dp"
                >

                <it.integry.integrywmsnative.ui.ElevatedToolbar
                    android:id="@+id/elevated_toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <androidx.appcompat.widget.Toolbar
                        android:id="@+id/toolbar"
                        android:layout_width="match_parent"
                        android:layout_height="?actionBarSize">
                        <androidx.appcompat.widget.AppCompatTextView
                            android:id="@+id/toolbar_title"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            tools:text="@string/edit_doc"
                            style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
                            android:layout_gravity="start" />
                        <androidx.appcompat.widget.AppCompatImageButton
                            android:id="@+id/add_extra_items_toolbar"
                            android:layout_width="wrap_content"
                            android:layout_height="50dp"
                            android:layout_gravity="end"
                            android:background="?attr/selectableItemBackground"
                            android:adjustViewBounds="true"
                            android:src="@drawable/ic_search_black_24dp"
                            android:onClick="@{()->view.manualSearch()}"
                            android:tint="@color/colorPrimaryGray"/>
                    </androidx.appcompat.widget.Toolbar>

                </it.integry.integrywmsnative.ui.ElevatedToolbar>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="8dp"
                    android:layout_marginRight="8dp"
                    android:background="@drawable/gray_detail_background_round8"
                    android:orientation="vertical"
                    android:padding="16dp">

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal">

                        <androidx.appcompat.widget.AppCompatTextView
                            style="@style/AppTheme.NewMaterial.Text.Small"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/document_label"
                            android:textColor="@android:color/black"
                            android:textSize="16sp" />

                        <androidx.appcompat.widget.AppCompatTextView
                            android:id="@+id/order_identifier"
                            style="@style/AppTheme.NewMaterial.Text.Small"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:textColor="@android:color/black"
                            android:textSize="16sp"
                            android:textStyle="bold"
                            app:binding="@{view.documentHeader}"
                            tools:text="#documentId" />
                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal">

                        <androidx.appcompat.widget.AppCompatTextView
                            style="@style/AppTheme.NewMaterial.Text.Small"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/doc_type"
                            android:textColor="@android:color/black" />

                        <androidx.appcompat.widget.AppCompatTextView
                            android:id="@+id/cod_dtip"
                            style="@style/AppTheme.NewMaterial.Text.Small"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:textColor="@android:color/black"
                            android:layout_marginStart="4dp"
                            android:textStyle="italic"
                            app:binding="@{view.codDtip}"
                            tools:text="CodDtip" />
                    </LinearLayout>

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

                        <androidx.appcompat.widget.AppCompatTextView
                            style="@style/AppTheme.NewMaterial.Text.Small"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/art_group"
                            android:textColor="@android:color/black" />

                        <androidx.appcompat.widget.AppCompatTextView
                            android:id="@+id/cod_mgrp"
                            style="@style/AppTheme.NewMaterial.Text.Small"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="4dp"
                            android:textColor="@android:color/black"
                            android:textStyle="italic"
                            app:binding="@{view.codMgrp}"
                            tools:text="CodMgrp" />
                    </LinearLayout>

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

                        <androidx.appcompat.widget.AppCompatTextView
                            style="@style/AppTheme.NewMaterial.Text.Small"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/document_rif_label"
                            android:textColor="@android:color/black"
                            android:textSize="16sp" />

                        <androidx.appcompat.widget.AppCompatTextView
                            android:id="@+id/document_rif"
                            style="@style/AppTheme.NewMaterial.Text.Small"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:textColor="@android:color/black"
                            android:textSize="16sp"
                            android:textStyle="bold"
                            app:binding="@{view.documentRifHeader}"
                            tools:text="#documentId" />
                    </LinearLayout>

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

                        <androidx.appcompat.widget.AppCompatTextView
                            style="@style/AppTheme.NewMaterial.Text.Small"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/fornitore"
                            android:textColor="@android:color/black" />

                        <androidx.appcompat.widget.AppCompatTextView
                            android:id="@+id/cod_anag"
                            style="@style/AppTheme.NewMaterial.Text.Small"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:textColor="@android:color/black"
                            android:layout_marginStart="4dp"
                            android:textStyle="italic"
                            app:binding="@{view.codAnag}"
                            tools:text="F000 - 01" />
                    </LinearLayout>


                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="12dp"
                        android:orientation="horizontal">

                        <androidx.appcompat.widget.AppCompatTextView
                            style="@style/AppTheme.NewMaterial.Text.Small"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/prod_count"
                            android:textColor="@android:color/black" />

                        <androidx.appcompat.widget.AppCompatTextView
                            android:id="@+id/count_art_ord"
                            style="@style/AppTheme.NewMaterial.Text.Small"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:textColor="@android:color/black"
                            android:textStyle="bold"
                            android:layout_marginStart="4dp"
                            app:binding="@{view.prodsCount}"
                            tools:text="10" />
                    </LinearLayout>


                </LinearLayout>


                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/document_rows_list"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="16dp"
                    android:layout_marginBottom="92dp"
                    android:paddingStart="2dp"
                    android:paddingEnd="2dp" />
                <LinearLayout
                    android:id="@+id/scan_art_spinner"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:layout_marginTop="24dp"
                    android:visibility="visible"
                    android:orientation="horizontal">


                    <ProgressBar
                        android:id="@+id/progressBar"
                        style="?android:attr/progressBarStyle"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"/>

                    <androidx.appcompat.widget.AppCompatTextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textSize="16sp"
                        android:layout_marginStart="8dp"
                        android:layout_marginEnd="12dp"
                        android:layout_gravity="center_vertical"
                        android:gravity="center_horizontal"
                        style="@style/AppTheme.NewMaterial.Text"
                        android:text="@string/scan_item"/>
                </LinearLayout>

            </LinearLayout>

        </LinearLayout>


        <com.github.clans.fab.FloatingActionMenu
            android:id="@+id/close_activity_fab"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_anchor="@+id/linearLayout2"
            app:layout_anchorGravity="center"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:menu_icon="@drawable/ic_menu_24dp"
            fab:menu_animationDelayPerItem="50"
            fab:menu_backgroundColor="@color/white_bg_alpha"
            fab:menu_buttonSpacing="0dp"
            fab:menu_colorNormal="@color/success_color"
            fab:menu_colorPressed="@color/green_400"
            fab:menu_labels_colorNormal="@color/white"
            fab:menu_labels_colorPressed="@color/white_pressed"
            fab:menu_labels_colorRipple="#66FFFFFF"
            fab:menu_labels_cornerRadius="3dp"
            fab:menu_labels_hideAnimation="@anim/fab_slide_out_to_right"
            fab:menu_labels_margin="0dp"
            fab:menu_labels_padding="8dp"
            fab:menu_labels_paddingBottom="4dp"
            fab:menu_labels_paddingLeft="8dp"
            fab:menu_labels_paddingRight="8dp"
            fab:menu_labels_paddingTop="4dp"
            fab:menu_labels_position="left"
            fab:menu_labels_showAnimation="@anim/fab_slide_in_from_right"
            fab:menu_labels_showShadow="true"
            fab:menu_labels_textColor="@color/black_semi_transparent"
            fab:menu_labels_textSize="18sp"
            fab:menu_openDirection="up"
            fab:menu_shadowColor="#66000000"
            fab:menu_shadowRadius="4dp"
            fab:menu_shadowXOffset="1dp"
            fab:menu_shadowYOffset="3dp"
            fab:menu_showShadow="true">


            <com.github.clans.fab.FloatingActionButton
                android:id="@+id/export_document"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_black_upload"
                android:visibility="@{view.isDocumentExportable.get() ? View.VISIBLE : View.GONE}"
                app:fab_colorNormal="@color/white"
                app:fab_colorPressed="@color/white_pressed"
                app:fab_colorRipple="#66FFFFFF"
                app:onClick="@{() -> viewModel.exportDocument()}"
                fab:fab_label="@string/export_document" />
            <com.github.clans.fab.FloatingActionButton
                android:id="@+id/delete_document"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_delete_24dp"
                app:fab_colorNormal="@color/white"
                app:fab_colorPressed="@color/white_pressed"
                app:fab_colorRipple="#66FFFFFF"
                app:onClick="@{() -> viewModel.deleteDocument()}"
                fab:fab_label="@string/delete_document" />

            <com.github.clans.fab.FloatingActionButton
                android:id="@+id/save_document"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_check_black_24dp"
                android:visibility="visible"
                app:fab_colorNormal="@color/white"
                app:fab_colorPressed="@color/white_pressed"
                app:fab_colorRipple="#66FFFFFF"
                app:onClick="@{() -> viewModel.holdDocument()}"
                fab:fab_label="@string/save_document" />


        </com.github.clans.fab.FloatingActionMenu>
        <View
            android:id="@+id/bottom_sheet__mtb_colr_edit__background"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#99000000"
            android:visibility="gone"
            android:clickable="true"
            android:focusable="true"/>

        <it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditView
            android:id="@+id/bottom_sheet__mtb_colr_edit"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:behavior_hideable="true"
            app:behavior_peekHeight="0dp"
            app:layout_behavior=".view.bottom_sheet__base.AutoCloseBottomSheetBehavior" />
    </androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>