<?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="com.lukouguoji.module_base.ui.weight.search.layout.SearchLayoutType" />

        <variable
            name="viewModel"
            type="com.lukouguoji.hangban.page.query.list.HbQueryListViewModel" />
    </data>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/color_f2"
        android:orientation="vertical">

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

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginHorizontal="10dp"
            android:layout_marginTop="10dp"
            android:gravity="center_vertical">

            <com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
                hint='@{"请选择航班日期"}'
                icon='@{@drawable/img_date}'
                type="@{SearchLayoutType.DATE}"
                value="@={viewModel.date}"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1" />

            <com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
                hint='@{"请输入航班号"}'
                setTextAllCaps="@{true}"
                type="@{SearchLayoutType.INPUT}"
                value="@={viewModel.fNo}"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1" />

            <com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
                hint='@{"始发站"}'
                setTextAllCaps="@{true}"
                type="@{SearchLayoutType.INPUT}"
                value="@={viewModel.dep}"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="0.6" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="-"
                android:textSize="16sp" />

            <com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
                hint='@{"目的站"}'
                setTextAllCaps="@{true}"
                type="@{SearchLayoutType.INPUT}"
                value="@={viewModel.dest}"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="0.6" />

            <com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
                hint='@{"请选择地区类型"}'
                list="@{viewModel.addressTypeList}"
                type="@{SearchLayoutType.SPINNER}"
                value="@={viewModel.addressType}"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1" />

            <com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
                hint='@{"请选择服务类型"}'
                list="@{viewModel.serviceTypeList}"
                type="@{SearchLayoutType.SPINNER}"
                value="@={viewModel.serviceType}"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1" />

            <!-- 搜索按钮 -->
            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:gravity="center_vertical|start"
                android:orientation="horizontal"
                android:paddingHorizontal="24dp">

                <ImageView
                    android:layout_width="36dp"
                    android:layout_height="36dp"
                    android:onClick="@{()-> viewModel.searchClick()}"
                    android:padding="2dp"
                    android:src="@drawable/img_search" />

            </LinearLayout>

        </LinearLayout>

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

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

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

        <!-- 底部统计栏 -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:background="@color/white"
            android:gravity="center_vertical"
            android:paddingHorizontal="15dp">

            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:gravity="center_vertical"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text='@{"合计："+viewModel.count+"条"}'
                    android:textColor="@color/bottom_tool_tips_text_color"
                    android:textSize="18sp"
                    android:textStyle="bold"
                    tools:text="合计:3条" />

            </LinearLayout>

        </LinearLayout>

    </LinearLayout>
</layout>
