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

        <import type="androidx.databinding.ObservableList" />

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

        <import type="android.view.View" />

        <variable
            name="view"
            type="it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeFragment" />

        <variable
            name="viewmodel"
            type="it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeViewModel" />
    </data>

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/empty_view_bg_gray"
        android:clipToPadding="false"
        tools:context=".gest.rettifica_giacenze.RettificaGiacenzeFragment">

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

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

                <androidx.appcompat.widget.LinearLayoutCompat
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@color/full_white"
                    android:orientation="vertical">

                    <net.cachapa.expandablelayout.ExpandableLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:padding="8dp"
                        app:el_expanded_bind="@{view.thereIsAnOpenedUL}">

                        <androidx.appcompat.widget.LinearLayoutCompat
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:background="@drawable/badge_round_corner"
                            android:backgroundTint="@color/colorPrimary"
                            android:orientation="horizontal">

                            <androidx.appcompat.widget.AppCompatTextView
                                style="@style/AppTheme.NewMaterial.Text.Medium"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:paddingStart="12dp"
                                android:paddingTop="8dp"
                                android:paddingEnd="2dp"
                                android:paddingBottom="8dp"
                                android:text="num:"
                                android:textColor="@android:color/white" />

                            <androidx.appcompat.widget.AppCompatTextView
                                style="@style/AppTheme.NewMaterial.Text.Medium"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:paddingStart="0dp"
                                android:paddingTop="8dp"
                                android:paddingEnd="12dp"
                                android:paddingBottom="8dp"
                                android:text="@{view.currentMtbColtObs.numCollo.toString()}"
                                android:textColor="@android:color/white"
                                android:textStyle="bold"
                                tools:text="2156" />

                            <androidx.appcompat.widget.AppCompatTextView
                                style="@style/AppTheme.NewMaterial.Text.Medium"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:paddingStart="12dp"
                                android:paddingTop="8dp"
                                android:paddingEnd="2dp"
                                android:paddingBottom="8dp"
                                android:text="pos:"
                                android:textColor="@android:color/white"
                                android:visibility="@{!UtilityString.isNullOrEmpty(viewmodel.currentMtbColt.posizione) ? View.VISIBLE : View.GONE}" />

                            <androidx.appcompat.widget.AppCompatTextView
                                style="@style/AppTheme.NewMaterial.Text.Medium"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="@{view.currentMtbColtObs.posizione}"
                                android:textColor="@android:color/white"
                                android:textStyle="bold"
                                android:visibility="@{!UtilityString.isNullOrEmpty(viewmodel.currentMtbColt.posizione) ? View.VISIBLE : View.GONE}"
                                tools:text="ME1FS032" />


                        </androidx.appcompat.widget.LinearLayoutCompat>

                    </net.cachapa.expandablelayout.ExpandableLayout>

                    <androidx.appcompat.widget.LinearLayoutCompat
                        android:id="@+id/rettifica_giacenze_forn_layout"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="4dp"
                        android:layout_marginTop="4dp"
                        android:layout_marginBottom="4dp"
                        android:orientation="horizontal"
                        android:padding="8dp">

                        <RadioButton
                            android:id="@+id/rettifica_giacenze_forn_check_box"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="end|center_vertical"
                            android:onClick="@{() -> view.setUIToForn()}" />


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

                            <com.google.android.material.textfield.TextInputLayout
                                android:id="@+id/auto_complete_fornitori_layout"
                                style="@style/TextInputLayout.NoLine"
                                android:layout_width="wrap_content"
                                android:layout_height="match_parent"
                                android:layout_weight="3"
                                app:hintTextAppearance="@style/hint_text">

                                <androidx.appcompat.widget.AppCompatAutoCompleteTextView
                                    android:id="@+id/auto_complete_fornitori"
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent"
                                    android:completionThreshold="2"
                                    android:ems="10"
                                    android:hint="@string/supplier"
                                    android:paddingStart="12dp"
                                    android:singleLine="true" />

                            </com.google.android.material.textfield.TextInputLayout>

                            <com.google.android.material.textfield.TextInputLayout
                                android:id="@+id/layout_cod_art_descr_forn"
                                style="@style/TextInputLayout.NoLine"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginStart="8dp"
                                android:layout_weight="7"
                                app:hintTextAppearance="@style/hint_text">

                                <com.google.android.material.textfield.TextInputEditText
                                    android:id="@+id/input_cod_art_descr_forn"
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content"
                                    android:hint="@string/cod_art_or_description"
                                    android:imeOptions="actionDone"
                                    android:inputType="textNoSuggestions"
                                    android:singleLine="true" />


                            </com.google.android.material.textfield.TextInputLayout>

                        </androidx.appcompat.widget.LinearLayoutCompat>
                    </androidx.appcompat.widget.LinearLayoutCompat>

                    <LinearLayout
                        android:id="@+id/rettifica_giacenze_art_int_layout"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="4dp"
                        android:layout_marginTop="4dp"
                        android:layout_marginBottom="4dp"
                        android:orientation="horizontal"
                        android:paddingStart="8dp"
                        android:paddingTop="6dp"
                        android:paddingEnd="6dp"
                        android:paddingBottom="6dp">

                        <RadioButton
                            android:id="@+id/rettifica_giacenze_art_int_check_box"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:onClick="@{() -> view.setUIToIntArt()}" />

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


                            <com.google.android.material.textfield.TextInputLayout
                                android:id="@+id/layout_cod_art_descr_int"
                                style="@style/TextInputLayout.NoLine"
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                app:hintTextAppearance="@style/hint_text"
                                app:layout_constraintEnd_toEndOf="parent"
                                app:layout_constraintStart_toStartOf="parent"
                                app:layout_constraintTop_toTopOf="parent">

                                <com.google.android.material.textfield.TextInputEditText
                                    android:id="@+id/input_cod_art_descr_int"
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content"
                                    android:hint="@string/cod_art_or_description"
                                    android:imeOptions="actionDone"
                                    android:inputType="textNoSuggestions"
                                    android:singleLine="true" />


                            </com.google.android.material.textfield.TextInputLayout>


                        </androidx.constraintlayout.widget.ConstraintLayout>
                    </LinearLayout>


                </androidx.appcompat.widget.LinearLayoutCompat>

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

                    <androidx.constraintlayout.widget.ConstraintLayout
                        android:id="@+id/rettifica_giacenze_empty_view"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:alpha="0.3"
                        tools:context=".gest.lista_bancali.ListaBancaliActivity">

                        <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.15" />

                        <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:gravity="center_horizontal"
                            android:orientation="vertical"
                            app:layout_constraintEnd_toStartOf="@id/guideline_empty_right"
                            app:layout_constraintStart_toEndOf="@id/guideline_empty_left"
                            app:layout_constraintTop_toTopOf="@id/guideline_empty_top">

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

                            <androidx.appcompat.widget.AppCompatTextView
                                style="@style/AppTheme.NewMaterial.Text.Medium"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:gravity="center_horizontal"
                                android:text="@string/no_item_text"
                                android:textColor="@android:color/black" />
                        </LinearLayout>

                    </androidx.constraintlayout.widget.ConstraintLayout>

                    <androidx.recyclerview.widget.RecyclerView
                        android:id="@+id/rettifica_giacenze_main_list"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:clipToPadding="false"
                        android:paddingTop="16dp"
                        android:paddingBottom="80dp"
                        android:scrollbarStyle="outsideOverlay"
                        tools:listitem="@layout/lista_rettifica_giacenze_model" />

                    <com.google.android.material.floatingactionbutton.FloatingActionButton
                        android:id="@+id/rettifica_giacenze_main_fab"
                        style="@style/Widget.MaterialComponents.FloatingActionButton"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentEnd="true"
                        android:layout_alignParentBottom="true"
                        android:layout_gravity="bottom|end"
                        android:layout_margin="@dimen/fab_margin"
                        android:onClick="@{() -> viewmodel.closeLU(true)}"
                        android:tint="@android:color/white"
                        app:srcCompat="@drawable/ic_check_black_24dp"
                        app:visibility="@{view.thereIsAnOpenedUL}" />

                </RelativeLayout>

            </androidx.appcompat.widget.LinearLayoutCompat>

            <View
                android:id="@+id/bottom_sheet__mtb_colr_edit__background"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="#99000000"
                android:clickable="true"
                android:focusable="true"
                android:visibility="gone" />

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

    </FrameLayout>
</layout>