<?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="android.view.View" />

        <import type="java.math.BigDecimal" />

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


        <variable
            name="viewModel"
            type="it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel" />

        <variable
            name="view"
            type="it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentView" />
    </data>

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/full_white"
        android:clickable="true"
        android:focusable="true">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/bottom_sheet"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#ffffffff"
            android:orientation="vertical">

            <androidx.cardview.widget.CardView
                android:layout_width="0dp"
                android:layout_height="0dp"
                app:cardCornerRadius="8dp"
                app:cardElevation="4dp"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent">

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


                    <androidx.constraintlayout.widget.ConstraintLayout
                        android:id="@+id/title_layout"
                        android:layout_width="match_parent"
                        android:layout_height="66dp"
                        android:background="@color/colorAccent"
                        android:paddingStart="16dp"
                        android:paddingTop="8dp"
                        android:paddingEnd="8dp"
                        android:paddingBottom="8dp">


                        <View
                            android:id="@+id/indicator_view"
                            android:layout_width="24dp"
                            android:layout_height="4dp"
                            android:alpha="0.5"
                            android:background="@drawable/badge_round_corner"
                            android:backgroundTint="@android:color/white"
                            app:layout_constraintEnd_toEndOf="parent"
                            app:layout_constraintStart_toStartOf="parent"
                            app:layout_constraintTop_toTopOf="parent" />

                        <androidx.appcompat.widget.LinearLayoutCompat
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:background="@color/colorAccent"
                            app:layout_constraintBottom_toBottomOf="parent"
                            app:layout_constraintStart_toStartOf="parent"
                            app:layout_constraintTop_toBottomOf="@id/indicator_view">

                            <androidx.appcompat.widget.AppCompatImageView
                                android:layout_width="24dp"
                                android:layout_height="24dp"
                                android:tint="@android:color/white"
                                app:layout_constraintBottom_toBottomOf="parent"
                                app:layout_constraintStart_toStartOf="parent"
                                app:layout_constraintTop_toTopOf="parent"
                                app:srcCompat="@drawable/ic_box" />

                            <androidx.appcompat.widget.AppCompatTextView
                                android:id="@+id/textview_art_counter"
                                style="@style/AppTheme.NewMaterial.Text.Medium"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginStart="8dp"
                                android:textColor="@android:color/white"
                                android:textStyle="bold"
                                app:layout_constraintStart_toEndOf="@+id/imageView"
                                tools:text="2" />

                            <androidx.appcompat.widget.AppCompatTextView
                                android:id="@+id/textview_art_description"
                                style="@style/AppTheme.NewMaterial.Text.Medium"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginStart="4dp"
                                android:text="@string/article"
                                android:textAllCaps="false"
                                android:textColor="@android:color/white"
                                android:textStyle="bold"
                                app:layout_constraintStart_toEndOf="@+id/imageView" />

                        </androidx.appcompat.widget.LinearLayoutCompat>


                        <com.google.android.material.button.MaterialButton
                            android:id="@+id/btn_close_lu"
                            style="@style/Button.DangerFull"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_alignParentEnd="true"
                            android:layout_marginLeft="8dp"
                            android:layout_marginRight="8dp"
                            android:text="@string/action_close_ul"
                            app:layout_constraintBottom_toBottomOf="parent"
                            app:layout_constraintEnd_toEndOf="parent"
                            app:layout_constraintTop_toBottomOf="@id/indicator_view"
                            app:singleClick="@{() -> viewModel.closeCurrentLU()}"
                            app:strokeColor="@color/red_600" />
                    </androidx.constraintlayout.widget.ConstraintLayout>


                    <androidx.core.widget.NestedScrollView
                        android:layout_width="match_parent"
                        android:layout_height="match_parent">

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

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

                                <TextView
                                    style="@style/AppTheme.NewMaterial.Text"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_marginStart="10dp"
                                    android:layout_marginTop="10dp"
                                    android:text="@string/details_text"
                                    android:textAllCaps="true"
                                    android:textColor="@android:color/black"
                                    android:textStyle="bold" />

                                <LinearLayout
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content"
                                    android:orientation="vertical"
                                    android:padding="15dp">

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

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

                                        <androidx.appcompat.widget.AppCompatTextView
                                            style="@style/AppTheme.NewMaterial.Text.Small"
                                            android:layout_width="0dp"
                                            android:layout_height="wrap_content"
                                            android:layout_marginStart="8dp"
                                            android:text="@string/number_text"
                                            android:textColor="@android:color/black"
                                            app:layout_constraintEnd_toStartOf="@+id/guideline0"
                                            app:layout_constraintStart_toStartOf="parent"
                                            app:layout_constraintTop_toTopOf="parent" />

                                        <androidx.appcompat.widget.LinearLayoutCompat
                                            android:layout_width="0dp"
                                            android:layout_height="0dp"
                                            android:visibility="@{viewModel.mtbColt != null ? View.VISIBLE : View.GONE}"
                                            app:layout_constraintBottom_toBottomOf="parent"
                                            app:layout_constraintEnd_toEndOf="parent"
                                            app:layout_constraintStart_toStartOf="@+id/guideline0"
                                            app:layout_constraintTop_toTopOf="parent">

                                            <androidx.appcompat.widget.AppCompatTextView
                                                style="@style/AppTheme.NewMaterial.Text.Small"
                                                android:layout_width="wrap_content"
                                                android:layout_height="wrap_content"
                                                android:text="@{viewModel.mtbColt.numCollo.toString()}"
                                                tools:text="TextView" />

                                            <androidx.appcompat.widget.AppCompatTextView
                                                style="@style/AppTheme.NewMaterial.Text.Small"
                                                android:layout_width="wrap_content"
                                                android:layout_height="wrap_content"
                                                android:textColor="#57535D"
                                                android:layout_marginStart="4dp"
                                                android:text="(serie: " />

                                            <androidx.appcompat.widget.AppCompatTextView
                                                style="@style/AppTheme.NewMaterial.Text.Small"
                                                android:layout_width="wrap_content"
                                                android:layout_height="wrap_content"
                                                android:textColor="#57535D"
                                                android:text="@{viewModel.mtbColt.serCollo}"
                                                android:textStyle="bold"
                                                tools:text="TextView" />

                                            <androidx.appcompat.widget.AppCompatTextView
                                                style="@style/AppTheme.NewMaterial.Text.Small"
                                                android:layout_width="wrap_content"
                                                android:layout_height="wrap_content"
                                                android:textColor="#57535D"
                                                android:text=")" />
                                        </androidx.appcompat.widget.LinearLayoutCompat>

                                    </androidx.constraintlayout.widget.ConstraintLayout>

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

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

                                        <androidx.appcompat.widget.AppCompatTextView
                                            style="@style/AppTheme.NewMaterial.Text.Small"
                                            android:layout_width="0dp"
                                            android:layout_height="wrap_content"
                                            android:layout_marginStart="8dp"
                                            android:text="@string/date_text"
                                            android:textColor="@android:color/black"
                                            app:layout_constraintEnd_toStartOf="@+id/guideline1"
                                            app:layout_constraintStart_toStartOf="parent"
                                            app:layout_constraintTop_toTopOf="parent" />

                                        <androidx.appcompat.widget.AppCompatTextView
                                            style="@style/AppTheme.NewMaterial.Text.Small"
                                            android:layout_width="0dp"
                                            android:layout_height="0dp"
                                            android:text="@{viewModel.mtbColt.dataColloHumanLong}"
                                            app:layout_constraintBottom_toBottomOf="parent"
                                            app:layout_constraintEnd_toEndOf="parent"
                                            app:layout_constraintStart_toStartOf="@+id/guideline1"
                                            app:layout_constraintTop_toTopOf="parent"
                                            tools:text="TextView" />

                                    </androidx.constraintlayout.widget.ConstraintLayout>

                                    <androidx.constraintlayout.widget.ConstraintLayout
                                        android:layout_width="match_parent"
                                        android:layout_height="wrap_content"
                                        android:visibility="@{UtilityString.isNullOrEmpty(viewModel.mtbColt.posizione) ? View.GONE : View.VISIBLE}">

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

                                        <androidx.appcompat.widget.AppCompatTextView
                                            android:id="@+id/articoli_in_collo_details_posizione"
                                            android:layout_width="0dp"
                                            android:layout_height="wrap_content"
                                            android:layout_marginStart="8dp"
                                            android:text="@string/position_text"
                                            android:textColor="@android:color/black"
                                            app:layout_constraintEnd_toStartOf="@+id/guideline2"
                                            app:layout_constraintStart_toStartOf="parent"
                                            app:layout_constraintTop_toTopOf="parent" />

                                        <androidx.appcompat.widget.AppCompatTextView
                                            style="@style/AppTheme.NewMaterial.Text.Small"
                                            android:layout_width="0dp"
                                            android:layout_height="0dp"
                                            android:text="@{viewModel.mtbColt.posizione}"
                                            app:layout_constraintBottom_toBottomOf="parent"
                                            app:layout_constraintEnd_toEndOf="parent"
                                            app:layout_constraintStart_toStartOf="@+id/guideline2"
                                            app:layout_constraintTop_toTopOf="parent"
                                            tools:text="TextView" />

                                    </androidx.constraintlayout.widget.ConstraintLayout>

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

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

                                        <androidx.appcompat.widget.AppCompatTextView
                                            android:layout_width="0dp"
                                            android:layout_height="wrap_content"
                                            android:layout_marginStart="8dp"
                                            android:text="@string/prepared_by_text"
                                            android:textColor="@android:color/black"
                                            app:layout_constraintEnd_toStartOf="@+id/guideline3"
                                            app:layout_constraintStart_toStartOf="parent"
                                            app:layout_constraintTop_toTopOf="parent" />

                                        <androidx.appcompat.widget.AppCompatTextView
                                            style="@style/AppTheme.NewMaterial.Text.Small"
                                            android:layout_width="0dp"
                                            android:layout_height="0dp"
                                            android:text="@{viewModel.mtbColt.preparatoDa}"
                                            app:layout_constraintBottom_toBottomOf="parent"
                                            app:layout_constraintEnd_toEndOf="parent"
                                            app:layout_constraintStart_toStartOf="@+id/guideline3"
                                            app:layout_constraintTop_toTopOf="parent"
                                            tools:text="TextView" />

                                    </androidx.constraintlayout.widget.ConstraintLayout>

                                    <androidx.constraintlayout.widget.ConstraintLayout
                                        android:layout_width="match_parent"
                                        android:layout_height="wrap_content"
                                        android:visibility="@{UtilityString.isNullOrEmpty(viewModel.mtbColt.ragSocCliente) ? View.GONE : View.VISIBLE}"

                                        >

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

                                        <androidx.appcompat.widget.AppCompatTextView
                                            android:layout_width="0dp"
                                            android:layout_height="wrap_content"
                                            android:layout_marginStart="8dp"
                                            android:text="@string/customer"
                                            android:textColor="@android:color/black"
                                            app:layout_constraintEnd_toStartOf="@+id/guideline4"
                                            app:layout_constraintStart_toStartOf="parent"
                                            app:layout_constraintTop_toTopOf="parent" />

                                        <androidx.appcompat.widget.AppCompatTextView
                                            style="@style/AppTheme.NewMaterial.Text.Small"
                                            android:layout_width="0dp"
                                            android:layout_height="0dp"
                                            android:text="@{viewModel.mtbColt.ragSocCliente}"
                                            app:layout_constraintBottom_toBottomOf="parent"
                                            app:layout_constraintEnd_toEndOf="parent"
                                            app:layout_constraintStart_toStartOf="@+id/guideline4"
                                            app:layout_constraintTop_toTopOf="parent"
                                            tools:text="TextView" />

                                    </androidx.constraintlayout.widget.ConstraintLayout>

                                    <androidx.constraintlayout.widget.ConstraintLayout
                                        android:layout_width="match_parent"
                                        android:layout_height="wrap_content"
                                        android:visibility="@{UtilityString.isNullOrEmpty(viewModel.pesoNettoKg) ? View.GONE : View.VISIBLE}">

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

                                        <androidx.appcompat.widget.AppCompatTextView
                                            android:layout_width="0dp"
                                            android:layout_height="wrap_content"
                                            android:layout_marginStart="8dp"
                                            android:text="@string/net_weight"
                                            android:textColor="@android:color/black"
                                            app:layout_constraintEnd_toStartOf="@+id/guideline5"
                                            app:layout_constraintStart_toStartOf="parent"
                                            app:layout_constraintTop_toTopOf="parent" />

                                        <androidx.appcompat.widget.AppCompatTextView
                                            style="@style/AppTheme.NewMaterial.Text.Small"
                                            android:layout_width="0dp"
                                            android:layout_height="0dp"
                                            android:text="@{viewModel.pesoNettoKg}"
                                            app:layout_constraintBottom_toBottomOf="parent"
                                            app:layout_constraintEnd_toEndOf="parent"
                                            app:layout_constraintStart_toStartOf="@+id/guideline5"
                                            app:layout_constraintTop_toTopOf="parent"
                                            tools:text="TextView" />

                                    </androidx.constraintlayout.widget.ConstraintLayout>

                                    <androidx.constraintlayout.widget.ConstraintLayout
                                        android:layout_width="match_parent"
                                        android:layout_height="wrap_content"
                                        android:visibility="@{UtilityString.isNullOrEmpty(viewModel.pesoKg)? View.GONE : View.VISIBLE}">

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

                                        <androidx.appcompat.widget.AppCompatTextView
                                            android:layout_width="0dp"
                                            android:layout_height="wrap_content"
                                            android:layout_marginStart="8dp"
                                            android:text="@string/gross_weight"
                                            android:textColor="@android:color/black"
                                            app:layout_constraintEnd_toStartOf="@+id/guideline6"
                                            app:layout_constraintStart_toStartOf="parent"
                                            app:layout_constraintTop_toTopOf="parent" />

                                        <androidx.appcompat.widget.AppCompatTextView
                                            style="@style/AppTheme.NewMaterial.Text.Small"
                                            android:layout_width="0dp"
                                            android:layout_height="0dp"
                                            app:binding="@{viewModel.pesoKg}"
                                            app:layout_constraintBottom_toBottomOf="parent"
                                            app:layout_constraintEnd_toEndOf="parent"
                                            app:layout_constraintStart_toStartOf="@+id/guideline6"
                                            app:layout_constraintTop_toTopOf="parent"
                                            tools:text="TextView" />

                                    </androidx.constraintlayout.widget.ConstraintLayout>


                                </LinearLayout>


                            </LinearLayout>

                            <View
                                android:layout_width="match_parent"
                                android:layout_height="1dp"
                                android:layout_marginTop="24dp"
                                android:background="#ededed" />

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

                                <TextView
                                    style="@style/AppTheme.NewMaterial.Text"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_marginStart="10dp"
                                    android:layout_marginTop="10dp"
                                    android:text="@string/already_read_articles"
                                    android:textAllCaps="true"
                                    android:textColor="@android:color/black"
                                    android:textStyle="bold" />

                                <LinearLayout
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content"
                                    android:orientation="vertical"
                                    android:paddingTop="14dp">

                                    <LinearLayout
                                        android:layout_width="match_parent"
                                        android:layout_height="match_parent"
                                        android:layout_marginTop="16dp"
                                        android:layout_marginBottom="16dp"
                                        android:gravity="center"
                                        android:orientation="vertical"
                                        android:padding="16dp"
                                        android:visibility="@{viewModel.mtbColt == null || viewModel.mtbColt.mtbColr.size() == 0 ? View.VISIBLE : View.GONE}">

                                        <androidx.appcompat.widget.AppCompatImageView
                                            android:layout_width="wrap_content"
                                            android:layout_height="wrap_content"
                                            android:src="@drawable/ic_info_78dp"
                                            android:tint="@color/empty_view_gray" />

                                        <androidx.appcompat.widget.AppCompatTextView
                                            style="@style/AppTheme.NewMaterial.Text"
                                            android:layout_width="match_parent"
                                            android:layout_height="wrap_content"
                                            android:gravity="center"
                                            android:text="@string/empty_rows_in_mtbcolt"
                                            android:textColor="@color/empty_view_gray"
                                            android:textSize="20sp" />

                                    </LinearLayout>


                                    <androidx.recyclerview.widget.RecyclerView
                                        android:id="@+id/mtb_colr_recycler_view"
                                        android:layout_width="match_parent"
                                        android:layout_height="wrap_content"
                                        android:clickable="true"
                                        android:focusable="true"
                                        app:dividerThickness="0.5dp" />


                                </LinearLayout>


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


                    </androidx.core.widget.NestedScrollView>

                </androidx.appcompat.widget.LinearLayoutCompat>

            </androidx.cardview.widget.CardView>

        </androidx.constraintlayout.widget.ConstraintLayout>

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