<?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.data.layout.DataLayoutType" />

        <import type="com.lukouguoji.module_base.common.DetailsPageType" />

        <variable
            name="viewModel"
            type="com.lukouguoji.aerologic.page.accident.visa.details.AccidentVisaDetailsViewModel" />
        
    </data>

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

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

        <androidx.core.widget.NestedScrollView
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp">

                    <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
                        enable="@{viewModel.pageType != DetailsPageType.Details}"
                        title='@{"起始站："}'
                        setTextAllCaps="@{true}"
                        titleLength="@{13}"
                        type="@{DataLayoutType.INPUT}"
                        value="@={viewModel.dataBean.dep}"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1" />

                    <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
                        enable="@{viewModel.pageType == DetailsPageType.Add}"
                        required="@{viewModel.pageType == DetailsPageType.Add}"
                        title='@{"航班号："}'
                        setTextAllCaps="@{true}"
                        titleLength="@{7}"
                        type="@{DataLayoutType.INPUT}"
                        value="@={viewModel.dataBean.fno}"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp">

                    <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
                        enable="@{viewModel.pageType != DetailsPageType.Details}"
                        title='@{"飞机号："}'
                        titleLength="@{13}"
                        type="@{DataLayoutType.INPUT}"
                        value="@={viewModel.dataBean.registeration}"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1" />

                    <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
                        enable="@{viewModel.pageType != DetailsPageType.Details}"
                        title='@{"声明价值："}'
                        titleLength="@{7}"
                        type="@{DataLayoutType.INPUT}"
                        value="@={viewModel.dataBean.declareamount}"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp">

                    <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
                        enable="@{viewModel.pageType != DetailsPageType.Details}"
                        title='@{"负责商务载重的飞行组组员："}'
                        titleLength="@{13}"
                        type="@{DataLayoutType.INPUT}"
                        value="@={viewModel.dataBean.fltcrew}"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp">

                    <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
                        enable="@{viewModel.pageType != DetailsPageType.Details}"
                        title='@{"货运单或邮件路单号："}'
                        titleLength="@{13}"
                        type="@{DataLayoutType.INPUT}"
                        value="@={viewModel.dataBean.mawbno}"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp">

                    <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
                        enable="@{viewModel.pageType != DetailsPageType.Details}"
                        title='@{"发运站："}'
                        titleLength="@{13}"
                        type="@{DataLayoutType.INPUT}"
                        setTextAllCaps="@{true}"
                        value="@={viewModel.dataBean.dep}"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1" />

                    <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
                        enable="@{viewModel.pageType != DetailsPageType.Details}"
                        title='@{"到达站："}'
                        titleLength="@{7}"
                        type="@{DataLayoutType.INPUT}"
                        setTextAllCaps="@{true}"
                        value="@={viewModel.dataBean.dest}"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp">

                    <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
                        enable="@{viewModel.pageType != DetailsPageType.Details}"
                        title='@{"托运人名称及住址："}'
                        titleLength="@{13}"
                        type="@{DataLayoutType.INPUT}"
                        value="@={viewModel.dataBean.shipper}"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp">

                    <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
                        enable="@{viewModel.pageType != DetailsPageType.Details}"
                        title='@{"收货人名称及住址："}'
                        titleLength="@{13}"
                        type="@{DataLayoutType.INPUT}"
                        value="@={viewModel.dataBean.consignee}"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp">

                    <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
                        enable="@{viewModel.pageType != DetailsPageType.Details}"
                        title='@{"重量："}'
                        titleLength="@{13}"
                        type="@{DataLayoutType.INPUT}"
                        value="@={viewModel.dataBean.weight}"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1" />

                    <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
                        enable="@{viewModel.pageType != DetailsPageType.Details}"
                        title='@{"件数："}'
                        titleLength="@{7}"
                        type="@{DataLayoutType.INPUT}"
                        value="@={viewModel.dataBean.pc}"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp">

                    <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
                        enable="@{viewModel.pageType != DetailsPageType.Details}"
                        title='@{"包装情况："}'
                        titleLength="@{13}"
                        type="@{DataLayoutType.INPUT}"
                        value="@={viewModel.dataBean.packing}"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp">

                    <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
                        enable="@{viewModel.pageType != DetailsPageType.Details}"
                        title='@{"所附证件："}'
                        titleLength="@{13}"
                        type="@{DataLayoutType.INPUT}"
                        value="@={viewModel.dataBean.annex}"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp">

                    <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
                        enable="@{viewModel.pageType != DetailsPageType.Details}"
                        inputHeight="@{100}"
                        title='@{"事故发生或发现经过："}'
                        titleLength="@{13}"
                        type="@{DataLayoutType.INPUT}"
                        value="@={viewModel.dataBean.accidentdes}"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp">

                    <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
                        enable="@{viewModel.pageType != DetailsPageType.Details}"
                        title='@{"结论："}'
                        titleLength="@{13}"
                        type="@{DataLayoutType.INPUT}"
                        value="@={viewModel.dataBean.conclusion}"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp">

                    <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
                        enable="@{viewModel.pageType != DetailsPageType.Details}"
                        title='@{"收货人姓名："}'
                        titleLength="@{13}"
                        type="@{DataLayoutType.INPUT}"
                        value="@={viewModel.dataBean.name}"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1" />

                    <com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayout
                        enable="@{viewModel.pageType != DetailsPageType.Details}"
                        title='@{"职别或通讯处："}'
                        titleLength="@{7}"
                        type="@{DataLayoutType.INPUT}"
                        value="@={viewModel.dataBean.title}"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1" />

                </LinearLayout>

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/rv"
                    itemLayoutId="@{viewModel.itemLayoutId}"
                    viewHolder="@{viewModel.itemViewHolder}"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp"
                    app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
                    app:spanCount="4"
                    tools:listitem="@layout/item_image_select" />

            </LinearLayout>

        </androidx.core.widget.NestedScrollView>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:background="@color/color_bottom_layout"
            android:gravity="center_vertical"
            android:paddingHorizontal="15dp">

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

            <TextView
                style="@style/tv_bottom_btn"
                visible="@{viewModel.pageType != DetailsPageType.Details}"
                android:onClick="@{()-> viewModel.onCancelClick()}"
                android:text="取消" />

            <TextView
                style="@style/tv_bottom_btn"
                visible="@{viewModel.pageType != DetailsPageType.Details}"
                android:onClick="@{()-> viewModel.onSaveClick()}"
                android:text="保存" />

        </LinearLayout>

    </LinearLayout>

</layout>