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

        <variable
            name="dto"
            type="it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO" />

        <variable
            name="view"
            type="it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.filters.FilterCommessaLayoutView" />
    </data>


    <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"
            android:orientation="horizontal"
            android:layout_marginStart="16dp"
            android:layout_marginTop="16dp"
            android:layout_marginEnd="16dp">


            <androidx.appcompat.widget.LinearLayoutCompat
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentStart="true"
                android:layout_toStartOf="@id/search_view"
                android:orientation="vertical"
                app:reverse_visibility="@{view.enabledSearch}">

                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/bottom_sheet_actions_title"
                    style="@style/AppTheme.NewMaterial.Text.Medium"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:ellipsize="end"
                    android:maxLines="2"
                    android:paddingStart="0dp"
                    android:paddingEnd="8dp"
                    android:text="@{view.filterName}"
                    android:textColor="#444"
                    android:textStyle="bold"
                    tools:text="Nome filtro" />

                <androidx.appcompat.widget.AppCompatTextView
                    style="@style/AppTheme.NewMaterial.Text.Small"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:ellipsize="end"
                    android:maxLines="2"
                    android:paddingStart="0dp"
                    android:paddingEnd="8dp"
                    android:text="Seleziona la commessa che vuoi filtrare"
                    android:textColor="#444" />

            </androidx.appcompat.widget.LinearLayoutCompat>

            <androidx.appcompat.widget.SearchView
                android:id="@+id/search_view"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:backgroundTint="@android:color/white" />


        </RelativeLayout>

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/title_layout">


            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/recyclerview"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:focusableInTouchMode="true"
                android:orientation="vertical"
                app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHeight_max="270dp"
                app:layout_constraintHeight_min="200dp"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

        </androidx.constraintlayout.widget.ConstraintLayout>

        <com.google.android.material.button.MaterialButton
            android:id="@+id/save_btn"
            style="@style/Button.PrimaryFull"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:layout_marginEnd="16dp"
            android:layout_marginBottom="8dp"
            android:text="@string/confirm"
            app:singleClick="@{() -> view.onConfirm()}" />

    </androidx.appcompat.widget.LinearLayoutCompat>

</layout>