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

    <data>

        <import type="me.tatarka.bindingcollectionadapter2.BindingRecyclerViewAdapter" />

        <import type="me.goldze.mvvmhabit.binding.viewadapter.recyclerview.LayoutManagers" />

        <import type="me.goldze.mvvmhabit.binding.viewadapter.recyclerview.LineManagers" />

        <variable
            name="viewModel"
            type="com.phlx.anchorcollect.ui.fragment.vm.PerformanceVM" />

        <variable
            name="spinnerAdapter"
            type="android.widget.ArrayAdapter" />

        <variable
            name="adapter"
            type="BindingRecyclerViewAdapter" />

    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/color_bg"
        android:padding="5dp">

        <TextView
            android:id="@+id/tv_rfid_text"
            android:layout_width="0dp"
            android:layout_height="@dimen/dp_32"
            android:background="@drawable/bg_radius_stroke_white_5"
            android:gravity="center"
            android:hint="未扫到电子耳标"
            android:text=""
            android:textColor="@color/white"
            binding:layout_constraintLeft_toLeftOf="parent"
            binding:layout_constraintRight_toRightOf="parent"
            binding:layout_constraintTop_toTopOf="parent" />

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/rv_collect"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_marginTop="5dp"
            android:layout_marginLeft="-5dp"
            binding:adapter="@{adapter}"
            binding:itemBinding="@{viewModel.itemBinding}"
            binding:items="@{viewModel.observableList}"
            binding:layoutManager="@{LayoutManagers.grid(5)}"
            binding:layout_constraintBottom_toTopOf="@+id/card_99"
            binding:layout_constraintLeft_toLeftOf="parent"
            binding:layout_constraintRight_toRightOf="parent"
            binding:layout_constraintTop_toBottomOf="@+id/tv_rfid_text" />

        <androidx.appcompat.widget.LinearLayoutCompat
            android:id="@+id/card_99"
            android:layout_width="0dp"
            android:layout_height="37dp"
            android:background="@drawable/bg_radius_white_5"
            android:onClick="@{() ->viewModel.click(99)}"
            android:orientation="vertical"
            android:padding="5dp"
            binding:layout_constraintLeft_toLeftOf="parent"
            binding:layout_constraintRight_toLeftOf="@+id/card_save"
            binding:layout_constraintBottom_toBottomOf="parent"
            >

            <androidx.appcompat.widget.AppCompatTextView
                android:id="@+id/tv_title_16"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="备注"
                android:textColor="@color/colorPrimary"
                android:textSize="@dimen/sp_8" />

            <androidx.appcompat.widget.AppCompatTextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="1dp"
                android:text="@{viewModel.remarkParamEntity.showName}"
                android:textColor="@color/black"
                android:textSize="@dimen/sp_8" />
        </androidx.appcompat.widget.LinearLayoutCompat>

        <androidx.appcompat.widget.LinearLayoutCompat
            android:id="@+id/card_save"
            android:layout_width="100dp"
            android:layout_height="37dp"
            android:layout_marginLeft="5dp"
            android:background="@drawable/bg_radius_white_5"
            binding:layout_constraintBottom_toBottomOf="parent"
            binding:layout_constraintRight_toRightOf="parent"
            >
            <!--                binding:onClickCommand="@{viewModel.onCardSaveClick}"-->

            <androidx.appcompat.widget.AppCompatTextView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@drawable/bg_button_orange_gradient"
                android:gravity="center"
                android:text="保存"
                android:textColor="@color/white"
                android:textSize="@dimen/sp_12"
                binding:onClickCommand="@{viewModel.onSaveClick}"
                />
        </androidx.appcompat.widget.LinearLayoutCompat>
    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>