<?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="it.integry.integrywmsnative.core.utility.UtilityNumber" />

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

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

            <androidx.appcompat.widget.LinearLayoutCompat
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:gravity="center"
                android:orientation="vertical"
                android:paddingStart="12dp"
                android:paddingEnd="12dp">

                <androidx.appcompat.widget.AppCompatTextView
                    style="@style/AppTheme.NewMaterial.Text.Small"
                    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="@{mtbColt.numCollo.toString()}"
                    android:textColor="@android:color/white"
                    android:textStyle="bold"
                    tools:text="22222" />

                <androidx.appcompat.widget.AppCompatTextView
                    style="@style/AppTheme.NewMaterial.Text.Small"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:paddingLeft="6dp"
                    android:paddingTop="2dp"
                    android:paddingRight="6dp"
                    android:paddingBottom="2dp"
                    android:text="@{mtbColt.mtbColr.get(0).numCnf.intValue() + ` col`}"
                    android:textStyle="bold"
                    tools:text="45 col" />

            </androidx.appcompat.widget.LinearLayoutCompat>


            <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">

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

                        <androidx.appcompat.widget.AppCompatTextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_alignParentStart="true"
                            android:layout_toStartOf="@id/peso_lordo_collo"
                            android:text="@{mtbColt.getDataColloHumanLong()}"
                            android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
                            android:textColor="@android:color/black"
                            android:textSize="16sp"
                            tools:text="28 ottobre 2018" />

                        <androidx.appcompat.widget.AppCompatTextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_alignParentStart="true"
                            android:layout_toEndOf="@id/peso_lordo_collo"
                            android:layout_marginStart="4dp"
                            android:text="@{mtbColt.timeVers}"
                            android:textAppearance="@style/AppTheme.NewMaterial.Text.Small"
                            android:textColor="@android:color/black"
                            tools:text="28 ottobre 2018" />

                    </androidx.appcompat.widget.LinearLayoutCompat>

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/peso_lordo_collo"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentEnd="true"
                        android:layout_centerVertical="true"
                        android:background="@drawable/badge1_round_corner"
                        android:backgroundTint="@color/green_400"
                        android:paddingStart="6dp"
                        android:paddingEnd="6dp"
                        android:text="@{UtilityNumber.decimalToString(mtbColt.pesoKg, 0) + ` KG`}"
                        android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
                        android:textColor="@android:color/black"
                        android:textStyle="bold"
                        tools:text="658 KG" />


                </RelativeLayout>

                <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/peso_netto_collo"
                        android:text="@{`Linea: ` + mtbColt.codJfas}"
                        android:textAppearance="@style/AppTheme.NewMaterial.Text.Small"
                        android:visibility="@{UtilityString.isNullOrEmpty(mtbColt.codJfas) ? View.INVISIBLE : View.VISIBLE}"
                        tools:text="Linea: L3" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/peso_netto_collo"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentEnd="true"
                        android:layout_centerVertical="true"
                        android:text="@{UtilityNumber.decimalToString(mtbColt.pesoNettoKg, 0) + `KG netto`}"
                        android:textAppearance="@style/AppTheme.NewMaterial.Text.Small"
                        android:textColor="@android:color/black"
                        tools:text="628KG netto" />


                </RelativeLayout>
            </LinearLayout>

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