<?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="viewModel"
            type="com.lukouguoji.gjj.viewModel.GjjTallyAddViewModel" />

    </data>

    <androidx.appcompat.widget.LinearLayoutCompat
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/color_f2"
        android:orientation="vertical"
        tools:context=".activity.GjcBoxAssembleAddActivity">

        <include layout="@layout/title_tool_bar" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="25dp"
            android:text='@{"平板车：" + (viewModel.flatcarBean.carId ?? "")}'
            android:textColor="#333333"
            android:textSize="30dp"
            android:textStyle="bold" />

        <com.scwang.smart.refresh.layout.SmartRefreshLayout
            android:id="@+id/srl"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_marginTop="25dp"
            android:layout_weight="1"
            app:srlEnableLoadMore="false"
            app:srlEnableRefresh="false">

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/rv"
                itemLayoutId="@{viewModel.itemId}"
                viewHolder="@{viewModel.itemHolder}"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                tools:listitem="@layout/item_tally_add" />

        </com.scwang.smart.refresh.layout.SmartRefreshLayout>

        <androidx.appcompat.widget.LinearLayoutCompat
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:background="#5c6890"
            android:gravity="center_vertical"
            android:paddingHorizontal="15dp">

            <androidx.appcompat.widget.LinearLayoutCompat
                android:layout_width="0dp"
                android:layout_height="40dp"
                android:layout_marginLeft="20dp"
                android:layout_weight="1"
                android:background="@drawable/bg_search_row"
                android:gravity="center_vertical">

                <EditText
                    setFocusChangedListener="@{viewModel::onPbcOrUldChange}"
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="1"
                    android:background="@null"
                    android:hint="请输入平板车"
                    android:paddingLeft="8dp"
                    android:text="@={viewModel.plateOrUld}" />

                <ImageView
                    android:layout_width="40dp"
                    android:layout_height="match_parent"
                    android:layout_gravity="center"
                    android:onClick="@{viewModel::onPlateClick}"
                    android:padding="10dp"
                    android:src="@mipmap/scan_code" />

            </androidx.appcompat.widget.LinearLayoutCompat>

            <androidx.appcompat.widget.LinearLayoutCompat
                android:layout_width="0dp"
                android:layout_height="40dp"
                android:layout_marginLeft="20dp"
                android:layout_weight="1.3"
                android:background="@drawable/bg_search_row"
                android:gravity="center_vertical">

                <EditText
                    setFocusChangedListener="@{viewModel::onWaybillOrPieceChange}"
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="1"
                    android:background="@null"
                    android:hint="请输入运单号或分单号或件号"
                    android:paddingLeft="8dp"
                    android:text="@={viewModel.waybillOrPiece}" />

                <ImageView
                    android:layout_width="40dp"
                    android:layout_height="match_parent"
                    android:layout_gravity="center"
                    android:onClick="@{viewModel::onWaybillOrPieceClick}"
                    android:padding="10dp"
                    android:src="@mipmap/scan_code" />

            </androidx.appcompat.widget.LinearLayoutCompat>

            <View
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:layout_weight="1" />

            <TextView
                style="@style/tv_bottom_btn"
                android:onClick="@{viewModel::confirmClick}"
                android:text="确认" />

            <TextView
                style="@style/tv_bottom_btn"
                android:onClick="@{viewModel::cancelClick}"
                android:text="取消" />

        </androidx.appcompat.widget.LinearLayoutCompat>

    </androidx.appcompat.widget.LinearLayoutCompat>

</layout>