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

    <data>

        <variable
            name="sale"
            type="es.verdnatura.presentation.view.feature.sacador.model.Sale" />
    </data>

    <LinearLayout
        android:id="@+id/linear_main"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/layout_margin_1"
        android:layout_marginBottom="@dimen/layout_margin_min"
        android:orientation="vertical"

        >
        <!--CABECERA=================================================-->
        <LinearLayout
            android:id="@+id/item_row_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/rvHeadlines"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/content_layout"
                android:layout_marginTop="6dp"
                android:visibility="visible"
                 />

            <LinearLayout

                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/verdnatura_white"
                android:orientation="vertical"
                android:padding="@dimen/layout_margin_min"
                android:textColor="@color/verdnatura_black">

                <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:layout_marginRight="@dimen/layout_margin_min"
                        android:text="@string/Nivel"
                        android:textColor="@color/verdnatura_black"
                        android:textSize="@dimen/h8" />

                    <TextView
                        android:id="@+id/level"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginRight="@dimen/layout_margin_min"
                        android:text="@{sale.level}"
                        android:textColor="@color/verdnatura_black"
                        android:textSize="@dimen/h8"
                        android:textStyle="bold"
                        tool:text="2" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginRight="@dimen/layout_margin_min"
                        android:text="@string/Ticket"
                        android:textColor="@color/verdnatura_black"
                        android:textSize="@dimen/h8" />

                    <TextView
                        android:id="@+id/ticketFk"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@{Integer.toString(sale.ticketFk)}"
                        android:textColor="@color/verdnatura_black"
                        android:textSize="@dimen/h8"
                        android:textStyle="bold"
                        tool:text="123456789"

                        />


                    <TextView
                        android:id="@+id/previous"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="PREVIA"
                        android:layout_marginStart="20dp"
                        android:textColor="@color/verdnatura_black"
                        android:textSize="@dimen/h8"
                        android:textStyle="bold"
                        tool:text="PREVIA"

                        />

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

                        <ImageView
                            android:id="@+id/ivArrow"
                            android:layout_width="48dp"
                            android:layout_height="48dp"
                            android:layout_alignParentRight="true"
                            android:layout_marginRight="20dp"
                            android:rotation="180"
                            android:src="@drawable/ic_arrow_down" />

                        <ImageView
                            android:id="@+id/imageErrorMessage"
                            android:layout_width="wrap_content"
                            android:layout_height="match_parent"
                            android:layout_alignParentRight="true"
                            app:srcCompat="@drawable/emoticon_error_fragment" />


                    </RelativeLayout>

                </LinearLayout>


            </LinearLayout>


        </LinearLayout>

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

            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/content_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/verdnatura_black"
                android:paddingTop="@dimen/layout_margin_min"
                android:paddingBottom="@dimen/layout_margin_min">
                <!--SEMAFORO=================================================-->

                <LinearLayout
                    android:id="@+id/linearLayoutItem"
                    android:layout_width="match_parent"
                    android:layout_height="20dp"
                    android:orientation="vertical"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent">

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

                        <TextView
                            android:id="@+id/item_article_itemFkNew"
                            android:layout_width="80dp"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="@dimen/layout_margin_min_to_modify"
                            android:layout_marginEnd="@dimen/layout_margin_min"
                            android:layout_weight="1"
                            android:maxLines="1"
                            android:text="@{Long.toString(sale.itemFk)}"
                            android:textColor="@color/verdnatura_white"
                            android:textSize="@dimen/body1"
                            android:textStyle="bold"
                            tool:text="9999999" />

                        <TextView
                            android:id="@+id/item_parking_code"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="1dp"
                            android:layout_marginEnd="@dimen/layout_margin_min"
                            android:layout_weight="0.5"
                            android:maxLines="1"
                            android:text="@{sale.parkingCode}"
                            android:textColor="@color/verdnatura_warm_grey"
                            android:textSize="@dimen/body1"
                            android:textStyle="bold"
                            tool:text="B-01-1" />

                        <TextView
                            android:id="@+id/item_code"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="1dp"
                            android:layout_marginEnd="@dimen/layout_margin_min"
                            android:layout_weight="0.5"
                            android:maxLines="1"
                            android:text="@{sale.code}"
                            android:textColor="@color/verdnatura_white"
                            android:textSize="@dimen/body1"
                            android:textStyle="bold"
                            tool:text="dIZXX" />


                        <TextView
                            android:id="@+id/item_first_to_picker"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginEnd="1dp"
                            android:layout_weight="0.5"
                            android:gravity="right"
                            android:text="25 x 5"
                            android:textColor="@color/verdnatura_white"
                            android:textSize="@dimen/body1"
                            android:textStyle="bold"
                            tool:text="25 x 1" />

                        <View
                            android:id="@+id/item_ticket_colors"
                            android:layout_width="@dimen/semaforo_width"
                            android:layout_height="@dimen/ticketColor_height"
                            android:layout_marginBottom="1dp"
                            android:background="@drawable/border" />


                    </LinearLayout>
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/linearLayoutLongItem"
                    android:layout_width="match_parent"
                    android:layout_height="20dp"
                    android:orientation="vertical"
                    app:layout_constraintTop_toBottomOf="@+id/linearLayoutItem">

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginEnd="25dp">

                        <TextView
                            android:id="@+id/item_article_long_info"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="@dimen/layout_margin_min_to_modify"
                            android:layout_weight="1"
                            android:ellipsize="end"
                            android:maxLines="1"
                            android:text="@{sale.longName}"
                            android:textColor="@color/verdnatura_white"
                            android:textSize="@dimen/body1"
                            tool:text="información de la linea 1" />

                        <TextView
                            android:id="@+id/item_second_to_picker"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_weight="0.25"
                            android:gravity="right"
                            android:text="secPicker"
                            android:textColor="@color/verdnatura_white"
                            android:textSize="@dimen/body2"
                            android:textStyle="bold"
                            tool:text="5 x 5" />

                    </LinearLayout>
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/linearLayoutItemOrigin"
                    android:layout_width="match_parent"
                    android:layout_height="20dp"
                    android:orientation="vertical"
                    app:layout_constraintTop_toBottomOf="@+id/linearLayoutLongItem">

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginEnd="25dp">

                        <TextView
                            android:id="@+id/item_article_origin"
                            android:layout_width="200dp"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="@dimen/layout_margin_min_to_modify"
                            android:layout_weight="2"
                            android:ellipsize="end"
                            android:maxLines="1"
                            android:text="@{sale.origin}"
                            android:textColor="@color/verdnatura_white"
                            android:textSize="@dimen/body1"
                            tool:text="información de la linea Origin" />

                        <TextView
                            android:id="@+id/item_article_first_accumulate"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_weight="0.5"
                            android:gravity="start"
                            android:text="first_accum"
                            android:textColor="@color/verdnatura_brown_grey"
                            android:textSize="@dimen/body2"
                            android:textStyle="bold"
                            tool:text="5 x 5" />

                        <TextView
                            android:id="@+id/item_reserved_total_number"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_weight="0.5"
                            android:gravity="end"
                            android:text="reserved_to"
                            android:textColor="@color/verdnatura_brown_grey"
                            android:textSize="@dimen/body2"
                            android:textStyle="bold"
                            android:visibility="invisible"
                            tool:text="5 x 5" />


                    </LinearLayout>

                </LinearLayout>

                <LinearLayout
                    android:id="@+id/linearLayoutItemColor"
                    android:layout_width="match_parent"
                    android:layout_height="20dp"
                    android:orientation="vertical"
                    android:layout_marginEnd="25dp"
                    app:layout_constraintTop_toBottomOf="@+id/linearLayoutItemOrigin">

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

                        <TextView
                            android:id="@+id/item_article_color"
                            android:layout_width="200dp"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="@dimen/layout_margin_min_to_modify"
                            android:layout_weight="2"
                            android:ellipsize="end"
                            android:maxLines="1"
                            android:text="@{sale.color}"
                            android:textColor="@color/verdnatura_white"
                            android:textSize="@dimen/body1"
                            tool:text="información de la linea Color" />

                        <TextView
                            android:id="@+id/item_article_second_accumulate"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_weight="0.5"
                            android:gravity="start"
                            android:text="second_a"
                            android:textColor="@color/verdnatura_brown_grey"
                            android:textSize="@dimen/body2"
                            android:textStyle="bold"
                            tool:text="5 x 5" />

                        <TextView
                            android:id="@+id/item_reserved_number"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_weight="0.5"
                            android:gravity="end"
                            android:text="reser_n"
                            android:textColor="@color/verdnatura_brown_grey"
                            android:textSize="@dimen/body2"
                            android:textStyle="bold"
                            tool:text="5 x 5" />

                    </LinearLayout>

                </LinearLayout>

                <!--CONTENIDO=================================================-->
                <!--app:layout_constraintEnd_toStartOf="@+id/item_article_quantity_picked"-->

                <TextView
                    android:id="@+id/item_article_itemFk"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/layout_margin_min_to_modify"
                    android:layout_marginEnd="@dimen/layout_margin_min"
                    android:maxLines="1"
                    android:text="@{Long.toString(sale.itemFk)}"
                    android:textColor="@color/verdnatura_white"
                    android:textSize="@dimen/body1"
                    android:textStyle="bold"
                    android:visibility="invisible"
                    app:layout_constraintStart_toEndOf="@+id/linearLayoutItem"
                    app:layout_constraintTop_toTopOf="parent"
                    tool:text="85478" />

                <TextView
                    android:id="@+id/item_packing_text"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="10dp"
                    android:layout_marginEnd="@dimen/layout_margin_min"
                    android:maxLines="1"
                    android:text="@{sale.parkingCode}"
                    android:textColor="@color/verdnatura_warm_grey"
                    android:textSize="@dimen/body1"
                    android:textStyle="bold"
                    android:visibility="invisible"
                    app:layout_constraintStart_toEndOf="@+id/item_article_itemFk"
                    app:layout_constraintTop_toTopOf="parent"
                    tool:text="B-01-1" />

                <TextView

                    android:id="@+id/item_packing_itemFk"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="5dp"
                    android:layout_marginEnd="@dimen/layout_margin_min"
                    android:maxLines="1"
                    android:text="@{sale.code}"
                    android:textColor="@color/verdnatura_white"
                    android:textSize="@dimen/body1"
                    android:textStyle="bold"
                    android:visibility="invisible"
                    app:layout_constraintStart_toEndOf="@+id/item_packing_text"
                    app:layout_constraintTop_toTopOf="parent"
                    tool:text="IZXX" />


                <TextView
                    android:id="@+id/txtde"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="@dimen/layout_margin_min"
                    android:text="@string/de"
                    android:textColor="@color/verdnatura_white"
                    android:textSize="@dimen/body1"
                    android:visibility="gone"
                    app:layout_constraintEnd_toStartOf="@+id/item_article_quantityOld"
                    app:layout_constraintTop_toTopOf="parent" />

                <TextView
                    android:id="@+id/item_article_quantityOld"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="22dp"
                    android:paddingLeft="10dp"
                    android:paddingRight="10dp"
                    android:text="@{Integer.toString(sale.saleQuantity)}"

                    android:textColor="@color/verdnatura_white"
                    android:textSize="@dimen/body1"
                    android:textStyle="bold"
                    android:visibility="gone"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    tool:text="10" />


                <TextView
                    android:id="@+id/item_article_cel2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="22dp"
                    android:paddingLeft="10dp"
                    android:text="15 x 5"
                    android:textColor="@color/verdnatura_white"
                    android:textSize="@dimen/body1"
                    android:textStyle="bold"
                    android:visibility="invisible"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    tool:text="5x1" />

                <TextView
                    android:id="@+id/item_article_quantity_line1"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/layout_margin_min_to_modify"
                    android:layout_marginEnd="22dp"
                    android:ellipsize="end"
                    android:maxLines="1"
                    android:text="@{sale.longName}"
                    android:textColor="@color/verdnatura_white"
                    android:textSize="@dimen/body1"
                    android:visibility="invisible"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toEndOf="@+id/linearLayoutItem"
                    app:layout_constraintTop_toBottomOf="@+id/item_article_itemFk"
                    tool:text="información de la linea 1" />

                <TextView

                    android:id="@+id/item_article_cel1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="cel1"
                    android:textColor="@color/verdnatura_white"
                    android:textSize="@dimen/body2"
                    android:textStyle="bold"
                    android:visibility="invisible"
                    app:layout_constraintEnd_toEndOf="@+id/item_article_quantity_line1"
                    app:layout_constraintTop_toTopOf="@+id/item_article_quantity_line1"
                    tool:text="cel1" />

                <TextView
                    android:id="@+id/item_article_quantity_line2"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/layout_margin_min_to_modify"
                    android:layout_marginEnd="22dp"
                    android:ellipsize="end"
                    android:maxLines="1"
                    android:text="@{sale.origin}"
                    android:textColor="@color/verdnatura_white"
                    android:textSize="@dimen/body2"
                    android:visibility="invisible"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toEndOf="@+id/linearLayoutItem"
                    app:layout_constraintTop_toBottomOf="@+id/item_article_quantity_line1"
                    tool:text="información de la linea 2" />

                <TextView
                    android:id="@+id/item_article_quantity_picked"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/layout_margin_min_to_modify"
                    android:layout_marginEnd="@dimen/layout_margin_min"
                    android:text="@{Integer.toString(sale.reservedQuantity)}"
                    android:textColor="@color/verdnatura_white"
                    android:textSize="@dimen/body3"
                    android:textStyle="bold"
                    android:visibility="invisible"
                    app:layout_constraintEnd_toStartOf="@+id/txtdeNew"
                    app:layout_constraintTop_toTopOf="@+id/item_article_quantity_line2"
                    tool:text="0" />


                <TextView
                    android:id="@+id/txtdeNew"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="@dimen/layout_margin_min"
                    android:text="@string/de"
                    android:textColor="@color/verdnatura_white"
                    android:textSize="@dimen/body3"
                    android:visibility="invisible"
                    app:layout_constraintEnd_toStartOf="@+id/item_article_quantity"
                    app:layout_constraintTop_toTopOf="@+id/item_article_quantity_line2" />

                <TextView
                    android:id="@+id/item_article_cel2_Old"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="cel2"
                    android:textColor="@color/verdnatura_white"
                    android:textSize="@dimen/body3"
                    android:textStyle="bold"
                    android:visibility="gone"
                    app:layout_constraintEnd_toEndOf="@+id/item_article_quantity_line2"
                    app:layout_constraintTop_toTopOf="@+id/item_article_quantity_line2"
                    tool:text="cel2" />


                <TextView
                    android:id="@+id/item_article_quantity"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:paddingLeft="@dimen/layout_collection_quantity"
                    android:paddingTop="@dimen/layout_margin_minest"
                    android:paddingBottom="@dimen/default_layout_margin"
                    android:text="@{Integer.toString(sale.saleQuantity)}"
                    android:textColor="@color/verdnatura_white"
                    android:textSize="@dimen/body3"
                    android:textStyle="bold"
                    android:visibility="invisible"
                    app:layout_constraintEnd_toEndOf="@+id/item_article_quantity_line2"
                    app:layout_constraintTop_toTopOf="@+id/item_article_quantity_line2"
                    tool:text="100" />

                <TextView
                    android:id="@+id/item_article_quantity_line3"
                    android:layout_width="10dp"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/layout_margin_min_to_modify"
                    android:layout_marginEnd="22dp"
                    android:ellipsize="end"
                    android:maxLines="1"
                    android:text="@{sale.color}"
                    android:textColor="@color/verdnatura_white"
                    android:textSize="@dimen/body2"
                    android:visibility="invisible"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toEndOf="@+id/linearLayoutItem"
                    app:layout_constraintTop_toBottomOf="@+id/item_article_quantity_line2"
                    tool:text="información de la linea 3" />

                <TextView
                    android:id="@+id/item_second"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/layout_margin_min_to_modify"
                    android:layout_marginEnd="2dp"
                    android:ellipsize="end"
                    android:maxLines="1"
                    android:text="second"
                    android:textColor="@color/verdnatura_brown_grey"
                    android:textSize="@dimen/body2"
                    android:visibility="invisible"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toEndOf="@+id/item_article_quantity_line3"
                    app:layout_constraintTop_toBottomOf="@+id/item_article_quantity_line2"
                    tool:text="información de la linea 3" />

                <TextView
                    android:id="@+id/item_article_cel3"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="2/2"
                    android:textColor="@color/verdnatura_white"
                    android:textSize="@dimen/body2"
                    android:textStyle="bold"
                    android:visibility="invisible"
                    app:layout_constraintEnd_toEndOf="@+id/item_second"
                    app:layout_constraintTop_toTopOf="@+id/item_second"
                    tool:text="cel3" />

                <LinearLayout
                    android:id="@+id/linearLayoutColor"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintTop_toTopOf="parent">

                    <View
                        android:id="@+id/item_ticketColor"
                        android:layout_width="@dimen/semaforo_width"
                        android:layout_height="@dimen/ticketColor_height"
                        android:layout_marginBottom="1dp"
                        android:background="@drawable/border" />

                </LinearLayout>

            </androidx.constraintlayout.widget.ConstraintLayout>

            <LinearLayout
                android:layout_width="50dp"
                android:layout_height="50dp"
                android:layout_weight="1"></LinearLayout>
        </LinearLayout>

        <LinearLayout
            android:id="@+id/layout_error"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:visibility="gone">

            <TextView
                android:id="@+id/txt_error"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/verdnatura_red"
                android:textColor="@color/verdnatura_white"
                tool:text="Cantidad original 100" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="@color/verdnatura_white"></LinearLayout>

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/item_article_placements"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/verdnatura_background_item_picker"
            android:clipToPadding="false"
            android:visibility="gone"
            tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
            tools:listitem="@layout/item_placement_row"
            tools:orientation="horizontal" />
    </LinearLayout>
</layout>