<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">

    <data>

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

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

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

        <variable
            name="articolo"
            type="it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine" />
    </data>

    <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="8dp">

        <LinearLayout
            android:id="@+id/linearLayout"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            app:layout_constraintEnd_toStartOf="@+id/qta_box"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">


            <androidx.appcompat.widget.AppCompatTextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@{articolo.codMart}"
                android:textColor="@color/colorPrimary"
                android:textSize="14sp"
                android:textStyle="bold"
                tools:text="COD MART" />


            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:maxLines="1"
                android:text="@{articolo.descrizione}"
                android:textColor="@android:color/black"
                android:textSize="16sp"
                tools:text="Descrizione lunga articolo" />


            <!--<TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@{`Lotto: ` + mtbColr.getPartitaMag()}"
                android:textSize="14sp"
                android:visibility="@{UtilityString.isNullOrEmpty(mtbColr.getPartitaMag()) ? View.INVISIBLE : View.VISIBLE}"
                tools:text="Lotto: ABCDE" />-->

        </LinearLayout>


        <RelativeLayout
            android:id="@+id/qta_box"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingStart="12dp"
            android:paddingEnd="12dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <androidx.appcompat.widget.AppCompatTextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@drawable/badge1_round_corner"
                android:gravity="center"
                android:paddingLeft="6dp"
                android:paddingTop="2dp"
                android:paddingRight="6dp"
                android:paddingBottom="2dp"
                android:text="@{UtilityNumber.decimalToString(articolo.qtaOrd) + `\n` + articolo.untMis}"
                android:textColor="@android:color/white"
                android:textSize="16sp"
                android:textStyle="bold"
                tools:text="280.45\nCONF" />

        </RelativeLayout>

    </androidx.constraintlayout.widget.ConstraintLayout>


</layout>
