<?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:paddingTop="12dp"
    android:paddingEnd="12dp"
    android:paddingBottom="12dp"
    android:clickable="true"
    android:background="@drawable/ripple_effect">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toTopOf="parent"
        android:orientation="horizontal">

        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="center"
            android:paddingStart="12dp"
            android:paddingEnd="12dp">

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

        </RelativeLayout>


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

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

                <TextView
                    android:layout_toStartOf="@id/posizione_collo"
                    android:layout_alignParentStart="true"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="@android:color/black"
                    android:textSize="16sp"
                    android:text="@{mtbColt.getDataColloHumanLong()}"
                    tools:text="28 ottobre 2018" />

                <TextView
                    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:textSize="16sp"
                    android:textColor="@android:color/black"
                    android:textStyle="bold"
                    android:visibility="@{UtilityString.isNullOrEmpty(mtbColt.posizione) ? View.INVISIBLE : View.VISIBLE}"
                    tools:text="A01F01C01L01" />


            </RelativeLayout>


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

    </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>