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

<layout 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"
    xmlns:tools="http://schemas.android.com/tools">

    <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">


        <androidx.appcompat.widget.LinearLayoutCompat
            android:id="@+id/linearLayout2"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/full_white"
            android:descendantFocusability="blocksDescendants"
            android:orientation="vertical">

            <androidx.appcompat.widget.LinearLayoutCompat
                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="?attr/actionBarSize">

                        <androidx.appcompat.widget.AppCompatTextView
                            android:id="@+id/toolbar_title"
                            style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="start"
                            tools:text="@string/edit_doc" />

                        <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:adjustViewBounds="true"
                            android:background="?attr/selectableItemBackground"
                            android:onClick="@{()->view.manualSearch()}"
                            android:src="@drawable/ic_search_black_24dp"
                            android:tint="@color/colorPrimaryGray" />
                    </androidx.appcompat.widget.Toolbar>

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

                <androidx.cardview.widget.CardView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="12dp"
                    app:cardCornerRadius="16dp"
                    app:cardElevation="4dp">

                    <androidx.appcompat.widget.LinearLayoutCompat
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:background="@color/colorPrimary"
                        android:orientation="horizontal"
                        android:padding="16dp">


                        <androidx.appcompat.widget.AppCompatImageView
                            android:layout_width="30dp"
                            android:layout_height="30dp"
                            android:layout_gravity="center_vertical"
                            android:layout_marginEnd="16dp"
                            android:adjustViewBounds="true"
                            android:src="@drawable/ic_document_outline"
                            android:tint="@color/white" />


                        <androidx.appcompat.widget.LinearLayoutCompat
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:orientation="vertical">

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

                                <androidx.appcompat.widget.LinearLayoutCompat
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_alignParentStart="true"
                                    android:layout_marginTop="2dp"
                                    android:layout_toStartOf="@id/loaded_arts_info_layout"
                                    android:orientation="horizontal">

                                    <androidx.appcompat.widget.AppCompatTextView
                                        style="@style/AppTheme.NewMaterial.Text.TextBoxDashboard"
                                        android:layout_width="match_parent"
                                        android:layout_height="wrap_content"
                                        app:binding="@{view.documentHeader}"
                                        android:textColor="@android:color/white"
                                        tools:text="670" />

                                </androidx.appcompat.widget.LinearLayoutCompat>

                                <androidx.appcompat.widget.LinearLayoutCompat
                                    android:id="@+id/loaded_arts_info_layout"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_alignParentEnd="true"
                                    android:orientation="horizontal"
                                    app:singleClick="@{() -> view.showInfoArtDialog()}">


                                    <androidx.appcompat.widget.AppCompatTextView
                                        style="@style/AppTheme.NewMaterial.Text.TextBoxDashboard"
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:text="@{String.valueOf(viewModel.productsList.size())}"
                                        tools:text="10250" />

                                    <androidx.appcompat.widget.AppCompatTextView
                                        style="@style/AppTheme.NewMaterial.Text.TextBoxDashboard"
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:layout_marginStart="4dp"
                                        android:text="articoli" />

                                    <androidx.appcompat.widget.AppCompatImageView
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:layout_marginStart="4dp"
                                        android:adjustViewBounds="true"
                                        android:src="@drawable/ic_black_barcode_scanner"
                                        android:tint="@color/white" />

                                </androidx.appcompat.widget.LinearLayoutCompat>

                            </RelativeLayout>

                            <androidx.appcompat.widget.LinearLayoutCompat
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginTop="2dp"
                                android:orientation="horizontal">

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.TextBoxLittleDashboard"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="Rif:" />

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.TextBoxLittleDashboard"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_marginStart="4dp"
                                    android:text="Non definito"
                                    android:textStyle="italic"
                                    app:visibility="@{view.documentRifHeader.get().empty}" />

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.TextBoxLittleDashboard"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_marginStart="4dp"
                                    app:binding="@{view.documentRifHeader}"
                                    app:reverse_visibility="@{view.documentRifHeader.get().empty}" />
                            </androidx.appcompat.widget.LinearLayoutCompat>

                            <androidx.appcompat.widget.LinearLayoutCompat
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginTop="2dp"
                                android:orientation="horizontal">

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.TextBoxLittleDashboard"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="Fornitore:" />

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.TextBoxLittleDashboard"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_marginStart="4dp"
                                    android:text="Non definito"
                                    android:textStyle="italic"
                                    app:visibility="@{view.codAnag.get().empty}" />

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.TextBoxLittleDashboard"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_marginStart="4dp"
                                    app:binding="@{view.codAnag}"
                                    app:reverse_visibility="@{view.codAnag.get().empty}" />
                            </androidx.appcompat.widget.LinearLayoutCompat>

                        </androidx.appcompat.widget.LinearLayoutCompat>

                    </androidx.appcompat.widget.LinearLayoutCompat>

                </androidx.cardview.widget.CardView>

                <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"
                    tools:itemCount="5"
                    tools:listitem="@layout/activity_contab_doc_interno_row__list_single_item" />

                <androidx.appcompat.widget.LinearLayoutCompat
                    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:orientation="horizontal"
                    android:visibility="visible">


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

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

            </androidx.appcompat.widget.LinearLayoutCompat>

        </androidx.appcompat.widget.LinearLayoutCompat>

        <com.google.android.material.floatingactionbutton.FloatingActionButton
            style="?attr/floatingActionButtonPrimaryStyle"
            android:id="@+id/main_fab"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|end"
            android:layout_margin="16dp"
            app:singleClick="@{() -> view.showFabMenu()}"
            app:srcCompat="@drawable/ic_menu_24dp" />

    </androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>