<?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="checkState"
            type="androidx.databinding.ObservableBoolean" />

        <variable
            name="adapter"
            type="com.example.beijing_daxing.adapter.StoreCheckAdapter" />
    </data>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        tools:context=".OffLineCheckActivity">

        <TextView
            style="@style/title_text"
            android:layout_width="match_parent"
            android:layout_height="45dp"
            android:text="轮挡巡检" />

        <androidx.recyclerview.widget.RecyclerView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginTop="10dp"
            android:layout_weight="1"
            android:adapter="@{adapter}"
            android:background="@color/white"
            android:padding="10dp"
            app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="55dp"
            android:layout_marginTop="20dp"
            android:layout_marginBottom="20dp"
            android:orientation="horizontal">

            <Button
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginStart="20dp"
                android:layout_weight="1"
                android:backgroundTint="@{checkState?@color/yellow:@color/black}"
                android:onClick="offCheckRead"
                android:text='@{checkState?"停止读取":"开始扫描"}'
                android:textSize="20sp" />

            <Button
                style="@style/button_style"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:onClick="store_check_submit"
                android:text="提交" />

        </LinearLayout>
    </LinearLayout>
</layout>