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

        <import type="it.integry.integrywmsnative.core.utility.UtilityString" />

        <variable
            name="viewmodel"
            type="it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaFragment" />

    </data>

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


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

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"
                android:descendantFocusability="blocksDescendants"
                android:paddingTop="8dp">

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

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

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/cod_alis_name"
                            android:textColor="@android:color/black"
                            android:layout_marginEnd="8dp"
                            android:textSize="16sp" />

                        <TextView
                            android:id="@+id/cod_alis"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            tools:text="4SECCO"
                            android:textColor="@android:color/black"
                            android:textSize="16sp"
                            android:textStyle="bold" />

                        <TextView
                            android:id="@+id/descr_lis"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            tools:text="LISTINO FORMAT CEDI SECCO"
                            android:textColor="@android:color/black"
                            android:textSize="14sp"
                            android:layout_marginStart="4dp"
                            android:textStyle="italic" />
                    </LinearLayout>

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

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/deposit"
                            android:textColor="@android:color/black"
                            android:layout_marginEnd="8dp"
                            android:textSize="14sp" />

                        <TextView
                            android:id="@+id/descr_depo"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            tools:text="D09-PRIMO PREZZO - TRAETTA"
                            android:textColor="@android:color/black"
                            android:textSize="14sp"
                            android:textStyle="italic" />
                    </LinearLayout>

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

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/articoli_in_griglia"
                            android:textColor="@android:color/black"
                            android:layout_marginEnd="8dp"
                            android:textSize="14sp" />

                        <TextView
                            android:id="@+id/count_art_lis"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            tools:text="10"
                            android:textColor="@android:color/black"
                            android:textSize="14sp"
                            android:textStyle="bold" />
                    </LinearLayout>


                </LinearLayout>

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

                    >

                    <androidx.recyclerview.widget.RecyclerView
                        android:id="@+id/ordini_a_aperti_main_list"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginTop="16dp"
                        android:background="@color/full_white"
                        android:paddingStart="2dp"
                        android:paddingEnd="2dp" />

                    <androidx.constraintlayout.widget.ConstraintLayout
                        android:id="@+id/ordini_a_empty_view"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:alpha="0.3">

                        <androidx.constraintlayout.widget.Guideline
                            android:id="@+id/guideline_empty_top"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:orientation="horizontal"
                            app:layout_constraintGuide_percent="0.2" />

                        <androidx.constraintlayout.widget.Guideline
                            android:id="@+id/guideline_empty_left"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:orientation="vertical"
                            app:layout_constraintGuide_percent="0.15" />

                        <androidx.constraintlayout.widget.Guideline
                            android:id="@+id/guideline_empty_right"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:orientation="vertical"
                            app:layout_constraintGuide_percent="0.85" />

                        <LinearLayout
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:orientation="vertical"
                            android:gravity="center_horizontal"

                            app:layout_constraintStart_toEndOf="@id/guideline_empty_left"
                            app:layout_constraintEnd_toStartOf="@id/guideline_empty_right"
                            app:layout_constraintTop_toTopOf="@id/guideline_empty_top">

                            <androidx.appcompat.widget.AppCompatImageView
                                android:layout_width="72dp"
                                android:layout_height="wrap_content"
                                android:src="@drawable/ic_playlist_add_check_24dp"
                                android:adjustViewBounds="true" />

                            <androidx.appcompat.widget.AppCompatTextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:gravity="center_horizontal"
                                android:textColor="@android:color/black"
                                android:textSize="18sp"
                                android:text="@string/no_orders_found_message" />
                        </LinearLayout>

                    </androidx.constraintlayout.widget.ConstraintLayout>


                </RelativeLayout>
            </LinearLayout>
        </LinearLayout>


        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">


            <androidx.constraintlayout.widget.Guideline
                android:id="@+id/free_picking__suggestion_1__guideline_top"
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:orientation="horizontal"
                app:layout_constraintGuide_percent="0.3" />

            <androidx.constraintlayout.widget.Guideline
                android:id="@+id/free_picking__suggestion_1__guideline_left"
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:orientation="vertical"
                app:layout_constraintGuide_percent="0.2" />

            <androidx.constraintlayout.widget.Guideline
                android:id="@+id/free_picking__suggestion_1__guideline_right"
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:orientation="vertical"
                app:layout_constraintGuide_percent="0.8" />

        </androidx.constraintlayout.widget.ConstraintLayout>


        <com.github.clans.fab.FloatingActionButton
            android:id="@+id/fab_newOrder"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|end"
            android:layout_marginBottom="8dp"
            android:layout_marginEnd="8dp"
            android:src="@drawable/fab_add"
            android:onClick="@{() -> viewmodel.createNewOrder()}"
            android:visibility="gone"
            fab:fab_colorNormal="@color/success_color"
            fab:fab_colorPressed="@color/green_500"
            fab:fab_colorRipple="#66FFFFFF" />
    </androidx.coordinatorlayout.widget.CoordinatorLayout>

</layout>