<?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="android.view.View" />

        <variable
            name="item"
            type="it.integry.integrywmsnative.gest.accettazione_picking.filters.FilterPosizioneLayoutView.ListModel" />
    </data>

    <androidx.appcompat.widget.LinearLayoutCompat
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:padding="8dp"
        android:background="?android:attr/selectableItemBackground"
        android:clickable="@{item.enabled}"
        android:onClick="@{() -> item.selected.toggle()}">


        <androidx.appcompat.widget.AppCompatCheckBox
            android:id="@+id/checkbox"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            android:enabled="@{item.enabled}"
            app:checked="@{item.selected}"
            android:clickable="false"/>

        <androidx.appcompat.widget.LinearLayoutCompat
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_gravity="center_vertical"
            android:enabled="@{item.enabled}"
            android:clickable="false">


            <androidx.appcompat.widget.AppCompatTextView
                style="@style/AppTheme.NewMaterial.Text.Small"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:enabled="@{item.enabled}"
                android:text="@{item.originalModel}"
                app:visibility="@{!UtilityString.isNullOrEmpty(item.originalModel)}"
                tools:text="Posizione"
                android:clickable="false" />


            <androidx.appcompat.widget.AppCompatTextView
                style="@style/AppTheme.NewMaterial.Text.Small"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:enabled="@{item.enabled}"
                android:text="NESSUNA POSIZIONE"
                app:visibility="@{UtilityString.isNullOrEmpty(item.originalModel)}"
                android:clickable="false" />


        </androidx.appcompat.widget.LinearLayoutCompat>

    </androidx.appcompat.widget.LinearLayoutCompat>

</layout>