<?xml version="1.0" encoding="utf-8"?>

<layout xmlns:app="http://schemas.android.com/apk/res-auto">

    <data>

        <import type="it.integry.integrywmsnative.core.model.MtbColt" />

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

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

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

        <variable
            name="mtbColt"
            type="MtbColt" />
    </data>

    <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?attr/selectableItemBackground"
        android:clickable="true"
        android:paddingTop="12dp"
        android:paddingEnd="12dp"
        android:paddingBottom="12dp">

        <androidx.appcompat.widget.LinearLayoutCompat
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            app:layout_constraintTop_toTopOf="parent">


            <androidx.appcompat.widget.AppCompatTextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="12dp"
                android:background="@drawable/badge_round_corner"
                android:backgroundTint="@color/colorPrimary"
                android:layout_gravity="center"
                android:paddingLeft="6dp"
                android:paddingTop="2dp"
                android:paddingRight="6dp"
                android:paddingBottom="2dp"
                android:text="@{mtbColt.numCollo.toString()}"
                android:textColor="@android:color/white"
                android:textStyle="bold"
                tools:text="22222" />


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

                <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:layout_alignParentStart="true"
                        android:layout_toStartOf="@id/posizione_collo"
                        android:text="@{mtbColt.getDataColloHumanLong()}"
                        android:textColor="@android:color/black"
                        android:textSize="16sp"
                        tools:text="28 ottobre 2018" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/posizione_collo"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentEnd="true"
                        android:layout_centerVertical="true"
                        android:text="@{mtbColt.posizione}"
                        android:textColor="@android:color/black"
                        android:textSize="16sp"
                        android:textStyle="bold"
                        android:visibility="@{UtilityString.isNullOrEmpty(mtbColt.posizione) ? View.INVISIBLE : View.VISIBLE}"
                        tools:text="A01F01C01L01" />


                </RelativeLayout>


                <androidx.appcompat.widget.AppCompatTextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@{`Preparato da: ` + mtbColt.preparatoDa}"
                    android:textSize="14sp"
                    android:visibility="@{UtilityString.isNullOrEmpty(mtbColt.preparatoDa) ? View.INVISIBLE : View.VISIBLE}"
                    tools:text="Preparato da: Utente" />

            </androidx.appcompat.widget.LinearLayoutCompat>

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

</layout>