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


    <data>

        <variable
            name="view"
            type="it.integry.integrywmsnative.gest.inventario.picking.PickingInventarioActivity" />

        <variable
            name="viewmodel"
            type="it.integry.integrywmsnative.gest.inventario.picking.PickingInventarioViewModel" />
    </data>

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


        <androidx.appcompat.widget.LinearLayoutCompat
            android:id="@+id/header_content"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <com.google.android.material.appbar.AppBarLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:liftOnScroll="true"
                app:liftOnScrollTargetViewId="@id/scroll_view">

                <com.google.android.material.appbar.MaterialToolbar
                    android:id="@+id/toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="?attr/actionBarSize"
                    app:menu="@menu/picking_inventario_menu"
                    app:title="@string/activity_picking_inventario_title"
                    app:navigationIcon="@drawable/ic_close_24dp"
                    app:navigationIconTint="@android:color/black"/>

            </com.google.android.material.appbar.AppBarLayout>


            <androidx.core.widget.NestedScrollView
                android:id="@+id/scroll_view"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layout_behavior="@string/appbar_scrolling_view_behavior">

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

                    <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:id="@+id/profile_root_container"
                            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_inventario_header_outline"
                                android:tint="@android: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="wrap_content"
                                            android:layout_height="wrap_content"
                                            android:text="ID:"
                                            android:textColor="@android:color/white" />

                                        <androidx.appcompat.widget.AppCompatTextView
                                            style="@style/AppTheme.NewMaterial.Text.TextBoxDashboard"
                                            android:layout_width="match_parent"
                                            android:layout_height="wrap_content"
                                            android:layout_marginStart="4dp"
                                            android:text="@{viewmodel.currentInventario.idInventario.toString()}"
                                            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.showAvailableArts()}">


                                        <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.availableArts.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="Zona:" />

                                    <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 definita"
                                        android:textStyle="italic"
                                        app:visibility="@{viewmodel.currentInventario.zona == null}" />

                                    <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="@{viewmodel.currentInventario.zona}"
                                        app:visibility="@{viewmodel.currentInventario.zona != null}" />
                                </androidx.appcompat.widget.LinearLayoutCompat>

                            </androidx.appcompat.widget.LinearLayoutCompat>


                        </androidx.appcompat.widget.LinearLayoutCompat>


                    </androidx.cardview.widget.CardView>

                    <androidx.recyclerview.widget.RecyclerView
                        android:id="@+id/picking_inventario_main_list"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:nestedScrollingEnabled="false"
                        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                        tools:listitem="@layout/activity_picking_inventario__list_item" />

                </androidx.appcompat.widget.LinearLayoutCompat>

            </androidx.core.widget.NestedScrollView>

        </androidx.appcompat.widget.LinearLayoutCompat>


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