<?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="it.integry.integrywmsnative.core.utility.UtilityString" />
        <import type="it.integry.integrywmsnative.core.utility.UtilityDate" />

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

        <variable
            name="mtbPartitaMag"
            type="it.integry.integrywmsnative.core.model.MtbPartitaMag" />
    </data>


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


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


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


                <androidx.appcompat.widget.AppCompatTextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@{UtilityString.isNull(mtbPartitaMag.partitaMag, &quot;Nessun lotto&quot;)}"
                    style="@style/AppTheme.NewMaterial.Text.Medium"
                    android:textColor="@color/colorPrimary"
                    android:textStyle="bold"
                    tools:text="PARTITA MAG" />

                <androidx.appcompat.widget.AppCompatTextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Data scad: "
                    android:textSize="14sp"
                    android:textStyle="bold"
                    android:layout_toStartOf="@id/data_scad"
                    android:layout_marginEnd="4dp"
                    android:visibility="@{mtbPartitaMag.dataScad == null ? View.GONE : View.VISIBLE}" />

                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/data_scad"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentEnd="true"
                    android:text="@{UtilityDate.formatDate(mtbPartitaMag.dataScad, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN)}"
                    android:textSize="14sp"
                    android:textStyle="bold"
                    android:visibility="@{mtbPartitaMag.dataScad == null ? View.GONE : View.VISIBLE}"
                    tools:text="Data scad" />
            </RelativeLayout>


            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:text="@{UtilityString.isNull(mtbPartitaMag.descrizione, &quot;Nessuna descrizione&quot;)}"
                android:textColor="@android:color/black"
                android:textSize="16sp"
                tools:text="Descrizione lunga articolo" />


        </androidx.appcompat.widget.LinearLayoutCompat>


    </androidx.appcompat.widget.LinearLayoutCompat>

</layout>