<?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="tire"
            type="com.example.tyre.maintenance.been.BaseTyre" />

        <variable
            name="isUpdate"
            type="androidx.databinding.ObservableBoolean" />

        <variable
            name="photoState"
            type="androidx.databinding.ObservableBoolean" />
<variable
    name="adapter1"
    type="com.example.tyre.maintenance.adapter.DisposalFileAdapter" />
        <import type="android.view.View" />
    </data>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/bg_grey_top"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp">

            <View
                android:layout_width="4dp"
                android:layout_height="30dp"
                android:background="@color/blue1_1" />

            <TextView
                android:id="@+id/dialog_title"
                android:layout_width="match_parent"
                android:layout_height="30dp"
                android:layout_marginLeft="5dp"
                android:drawableEnd="@mipmap/ic_cha"
                android:gravity="center|left"
                android:paddingEnd="12dp"
                android:text="@{tire.wheelPostion}"
                android:textColor="@color/textColor1"
                android:textSize="14sp" />
        </LinearLayout>

        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent">

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

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="50dp"
                    android:background="@drawable/card_bg"
                    android:padding="12dp">

                    <TextView
                        android:id="@+id/textView4"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:text="是否更换轮胎"
                        android:textColor="@color/textColor1" />

                    <Switch
                        android:id="@+id/dialog_isupdate_switch"
                        android:layout_width="wrap_content"
                        android:layout_height="match_parent"
                        android:textColor="@color/textColor1"
                        android:textOff="否"
                        android:textOn="是" />
                </LinearLayout>

                <androidx.gridlayout.widget.GridLayout
                    style="@style/layout_card_style"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="12dp"
                    app:columnCount="2"
                    app:rowCount="5">


                    <TextView
                        android:layout_height="40dp"
                        android:gravity="left|center"
                        android:text="@{tire.tyreNo}"
                        android:textColor="@color/textColor1"
                        android:textSize="16sp"
                        app:layout_columnSpan="2" />

                    <LinearLayout
                        android:layout_height="40dp"
                        android:layout_marginTop="8dp"
                        android:gravity="center"
                        android:orientation="horizontal"
                        app:layout_columnSpan="2">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:background="@drawable/bg_green1_2"
                            android:padding="4dp"
                            android:text="@{tire.tyreBrand}"
                            android:textColor="@color/buttonColor2"
                            android:textSize="13sp"
                            app:layout_columnSpan="2" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="4dp"
                            android:background="@drawable/bg_blue1_2"
                            android:padding="4dp"
                            android:text="@{tire.tyrePattern}"
                            android:textColor="@color/blue1_1"
                            android:textSize="13sp"
                            app:layout_columnSpan="2" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="4dp"
                            android:background="@drawable/bg_orange1_2"
                            android:padding="4dp"
                            android:text="@{tire.tyreModel}"
                            android:textColor="@color/buttonColor"
                            android:textSize="13sp"
                            app:layout_columnSpan="2" />

                    </LinearLayout>

                    <View
                        android:layout_height="1dp"
                        android:layout_marginTop="8dp"
                        android:background="#F1F1F1"
                        app:layout_columnSpan="2" />


                    <TextView
                        android:layout_height="40dp"
                        android:gravity="left|center"
                        android:text="轮胎自编号"
                        android:textColor="@color/textColor1"
                        app:layout_columnWeight="1" />

                    <TextView
                        android:layout_height="40dp"
                        android:gravity="right|center"
                        android:text="@{tire.selfNo}"
                        android:textColor="@color/textColor1"
                        app:layout_columnWeight="1" />

                    <View
                        android:layout_height="1dp"
                        android:layout_marginTop="8dp"
                        android:background="#F1F1F1"
                        app:layout_columnSpan="2" />


                    <TextView
                        android:layout_height="40dp"
                        android:gravity="left|center"
                        android:text="花纹初始深度"
                        android:textColor="@color/textColor1"
                        app:layout_columnWeight="1" />

                    <TextView
                        android:layout_height="40dp"
                        android:gravity="right|center"
                        android:text='@{tire.patternDepth+" mm"}'
                        android:textColor="@color/textColor1"
                        app:layout_columnWeight="1" />


                    <View
                        android:layout_height="1dp"
                        android:background="#F1F1F1"
                        app:layout_columnSpan="2" />

                    <TextView
                        android:layout_height="40dp"
                        android:gravity="left|center"
                        android:text="轮胎与系统不一致"
                        android:textColor="@color/textColor1"
                        android:visibility="gone"
                        app:layout_columnWeight="1" />

                    <Switch
                        android:layout_height="40dp"
                        android:textColor="@color/textColor1"
                        android:visibility="gone"

                        app:layout_columnWeight="1"
                        tools:ignore="UseSwitchCompatOrMaterialXml" />


                    <View
                        android:layout_height="1dp"
                        android:background="#F1F1F1"
                        app:layout_columnSpan="2" />

                    <LinearLayout
                        android:layout_height="40dp"
                        android:layout_marginTop="8dp"
                        android:gravity="center"
                        android:orientation="horizontal"
                        app:layout_columnWeight="1">

                        <TextView
                            android:layout_width="10dp"
                            android:layout_height="wrap_content"
                            android:text="*"
                            android:textColor="#E53935" />

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="剩余花纹深度"
                            android:textColor="@color/textColor1"
                            app:layout_columnWeight="1" />
                    </LinearLayout>

                    <LinearLayout
                        android:layout_height="40dp"
                        android:layout_marginTop="8dp"
                        android:background="@drawable/bg_grey"
                        android:gravity="center"
                        android:orientation="horizontal"
                        android:padding="5dp"
                        app:layout_columnWeight="1">

                        <EditText
                            android:id="@+id/dialog_tire_shendu1"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:background="@color/blue1_3"
                            android:gravity="center"
                            android:inputType="numberDecimal"
                            android:textColor="@color/textColor1" />

                        <TextView
                            android:layout_width="40dp"
                            android:layout_height="match_parent"
                            android:layout_marginEnd="4dp"
                            android:background="@drawable/bg_blue1_2"
                            android:gravity="center"
                            android:text="mm"
                            android:textColor="@color/blue1_1" />
                    </LinearLayout>

                    <!--  <View
                          android:layout_height="1dp"
                          android:layout_marginTop="8dp"
                          android:background="#F1F1F1"
                          app:layout_columnSpan="2" />

                      <TextView
                          android:layout_height="40dp"
                          android:layout_marginTop="8dp"
                          android:gravity="left|center"
                          android:text="保养前胎压"
                          android:textColor="@color/textColor1"
                          app:layout_columnWeight="1" />

                      <LinearLayout
                          android:layout_height="40dp"
                          android:layout_marginTop="8dp"
                          android:background="@drawable/bg_grey"
                          android:gravity="center"
                          android:orientation="horizontal"
                          android:padding="5dp"
                          app:layout_columnWeight="1">

                          <TextView
                              android:layout_width="match_parent"
                              android:layout_height="match_parent"
                              android:layout_weight="1"
                              android:gravity="center"
                              android:inputType="numberDecimal"
                              android:textColor="@color/textColor1" />

                          <TextView
                              android:layout_width="40dp"
                              android:layout_height="match_parent"
                              android:layout_marginEnd="4dp"
                              android:background="@drawable/bg_blue1_2"
                              android:gravity="center"
                              android:text="kpa"
                              android:textColor="@color/blue1_1" />
                      </LinearLayout>-->

                    <View
                        android:layout_height="1dp"
                        android:layout_marginTop="8dp"
                        android:background="#F1F1F1"
                        app:layout_columnSpan="2" />

                    <TextView
                        android:layout_height="40dp"
                        android:layout_marginTop="8dp"
                        android:gravity="left|center"
                        android:text="保养前胎压"
                        android:textColor="@color/textColor1"
                        app:layout_columnWeight="1" />

                    <LinearLayout
                        android:layout_height="40dp"
                        android:layout_marginTop="8dp"
                        android:background="@drawable/bg_grey"
                        android:gravity="center"
                        android:orientation="horizontal"
                        android:padding="5dp"
                        app:layout_columnWeight="1">

                        <EditText
                            android:id="@+id/dialog_tire_taiya_old"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:background="@color/blue1_3"
                            android:gravity="center"
                            android:inputType="numberDecimal"
                            android:textColor="@color/textColor1" />

                        <TextView
                            android:layout_width="40dp"
                            android:layout_height="match_parent"
                            android:layout_marginEnd="4dp"
                            android:background="@drawable/bg_blue1_2"
                            android:gravity="center"
                            android:text="kpa"
                            android:textColor="@color/blue1_1" />
                    </LinearLayout>

                    <View
                        android:layout_height="1dp"
                        android:layout_marginTop="8dp"
                        android:background="#F1F1F1"
                        app:layout_columnSpan="2" />

                    <TextView
                        android:layout_height="40dp"
                        android:layout_marginTop="8dp"
                        android:gravity="left|center"
                        android:text="保养后胎压"
                        android:textColor="@color/textColor1"
                        app:layout_columnWeight="1" />

                    <LinearLayout
                        android:layout_height="40dp"
                        android:layout_marginTop="8dp"
                        android:background="@drawable/bg_grey"
                        android:gravity="center"
                        android:orientation="horizontal"
                        android:padding="5dp"
                        app:layout_columnWeight="1">

                        <EditText
                            android:id="@+id/dialog_tire_taiya1"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:background="@color/blue1_3"
                            android:gravity="center"
                            android:inputType="numberDecimal"
                            android:textColor="@color/textColor1" />

                        <TextView
                            android:layout_width="40dp"
                            android:layout_height="match_parent"
                            android:layout_marginEnd="4dp"
                            android:background="@drawable/bg_blue1_2"
                            android:gravity="center"
                            android:text="kpa"
                            android:textColor="@color/blue1_1" />
                    </LinearLayout>

                    <View
                        android:layout_height="1dp"
                        android:layout_marginTop="8dp"
                        android:background="#F1F1F1"
                        app:layout_columnSpan="2" />

                    <TextView
                        android:layout_height="40dp"
                        android:layout_marginTop="8dp"
                        android:gravity="left|center"
                        android:text="照片"
                        android:textColor="@color/textColor1"
                        app:layout_columnWeight="1" />


                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="90dp"
                        android:layout_marginTop="5dp"
                        android:background="@color/white"

                        android:orientation="horizontal"
                        app:layout_columnSpan="2">

                        <androidx.recyclerview.widget.RecyclerView
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:adapter="@{adapter1}"
                            android:orientation="horizontal"
                            android:paddingLeft="5dp"
                            android:paddingRight="5dp"
                            app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />

                        <ImageView
                            android:id="@+id/dialog_update_photo"
                            style="@style/text_block_style"
                            android:layout_width="50dp"
                            android:layout_height="50dp"
                            android:background="@drawable/bg_block_img_selector"
                            android:padding="10dp"
                            android:src="@mipmap/ic_xiangji"
                            />
                    </LinearLayout>

                    <View
                        android:layout_height="1dp"
                        android:layout_marginTop="8dp"
                        android:background="#F1F1F1"
                        app:layout_columnSpan="2" />

                    <TextView
                        android:layout_height="40dp"
                        android:layout_marginTop="8dp"
                        android:gravity="left|center"
                        android:text="备注"
                        android:textColor="@color/textColor1"
                        app:layout_columnWeight="1" />

                    <EditText
                        android:id="@+id/dialog_tire_remark1"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:background="@color/white"
                        android:gravity="top"
                        android:hint="输入备注"
                        android:minHeight="100dp"
                        android:padding="8dp"
                        android:textColor="@color/textColor1"
                        android:textSize="14sp"
                        app:layout_columnSpan="2" />

                </androidx.gridlayout.widget.GridLayout>

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="12dp"
                    android:text="换胎后"
                    android:textColor="@color/textColor1"
                    android:textSize="14sp"
                    android:visibility="@{isUpdate?View.VISIBLE:View.GONE}" />

                <androidx.gridlayout.widget.GridLayout
                    style="@style/layout_card_style"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="8dp"
                    android:visibility="@{isUpdate?View.VISIBLE:View.GONE}"
                    app:columnCount="2"
                    app:rowCount="5">

                    <Button
                        android:id="@+id/dialog_button_tong"
                        android:layout_width="match_parent"
                        android:layout_height="50dp"
                        android:layout_marginTop="12dp"
                        android:layout_marginBottom="12dp"
                        android:background="@drawable/bg_button_blue"
                        android:text="同车轮胎互换"
                        android:textColor="@color/white"
                        android:textSize="16sp"
                        android:textStyle="bold"
                        app:layout_columnSpan="2" />

                    <LinearLayout
                        android:layout_height="40dp"
                        android:gravity="center"
                        android:orientation="horizontal"
                        app:layout_columnWeight="1">

                        <TextView
                            android:layout_width="10dp"
                            android:layout_height="wrap_content"
                            android:text="*"
                            android:textColor="#E53935" />

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="装车轮胎扫描"
                            android:textColor="@color/textColor1"
                            app:layout_columnWeight="1" />
                    </LinearLayout>

                    <TextView
                        android:id="@+id/new_tire_info1"
                        android:layout_height="40dp"
                        android:gravity="right|center"
                        android:text=""
                        android:textColor="@color/textColor1"
                        app:layout_columnWeight="1" />


                    <View
                        android:layout_height="1dp"
                        android:background="#F1F1F1"
                        app:layout_columnSpan="2" />


                    <LinearLayout
                        android:layout_height="40dp"
                        android:layout_marginTop="8dp"
                        android:gravity="center"
                        android:orientation="horizontal"
                        app:layout_columnWeight="1">

                        <TextView
                            android:layout_width="10dp"
                            android:layout_height="wrap_content"
                            android:text="*"
                            android:textColor="#E53935" />

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="轮胎自编号"
                            android:textColor="@color/textColor1"
                            app:layout_columnWeight="1" />
                    </LinearLayout>


                    <EditText
                        android:id="@+id/new_tire_info2"
                        android:layout_height="40dp"
                        android:layout_marginTop="8dp"
                        android:gravity="center"
                        android:hint="输入轮胎自编号"
                        android:inputType="textVisiblePassword"
                        android:textColor="@color/textColor1"
                        app:layout_columnWeight="1" />

                    <View
                        android:layout_height="1dp"
                        android:background="#F1F1F1"
                        app:layout_columnSpan="2" />

                    <LinearLayout
                        android:layout_height="40dp"
                        android:layout_marginTop="8dp"
                        android:gravity="center"
                        android:orientation="horizontal"
                        app:layout_columnWeight="1">

                        <TextView
                            android:layout_width="10dp"
                            android:layout_height="wrap_content"
                            android:text="*"
                            android:textColor="#E53935" />

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="剩余花纹深度"
                            android:textColor="@color/textColor1"
                            app:layout_columnWeight="1" />
                    </LinearLayout>

                    <LinearLayout
                        android:layout_height="40dp"
                        android:layout_marginTop="8dp"
                        android:background="@drawable/bg_grey"
                        android:gravity="center"
                        android:orientation="horizontal"
                        android:padding="5dp"
                        app:layout_columnWeight="1">

                        <EditText
                            android:id="@+id/dialog_tire_shendu2"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:background="@color/blue1_3"
                            android:gravity="center"
                            android:inputType="numberDecimal"
                            android:textColor="@color/textColor1" />

                        <TextView
                            android:layout_width="40dp"
                            android:layout_height="match_parent"
                            android:layout_marginEnd="4dp"
                            android:background="@drawable/bg_blue1_2"
                            android:gravity="center"
                            android:text="mm"
                            android:textColor="@color/blue1_1" />
                    </LinearLayout>


                    <View
                        android:layout_height="1dp"
                        android:layout_marginTop="8dp"
                        android:background="#F1F1F1"
                        app:layout_columnSpan="2" />

                    <TextView
                        android:layout_height="40dp"
                        android:layout_marginTop="8dp"
                        android:gravity="left|center"
                        android:text="胎压"
                        android:textColor="@color/textColor1"
                        app:layout_columnWeight="1" />

                    <LinearLayout
                        android:layout_height="40dp"
                        android:layout_marginTop="8dp"
                        android:background="@drawable/bg_grey"
                        android:gravity="center"
                        android:orientation="horizontal"
                        android:padding="5dp"
                        app:layout_columnWeight="1">

                        <EditText
                            android:id="@+id/dialog_tire_taiya2"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:background="@color/blue1_3"
                            android:gravity="center"
                            android:inputType="numberDecimal"
                            android:textColor="@color/textColor1" />

                        <TextView
                            android:layout_width="40dp"
                            android:layout_height="match_parent"
                            android:layout_marginEnd="4dp"
                            android:background="@drawable/bg_blue1_2"
                            android:gravity="center"
                            android:text="kpa"
                            android:textColor="@color/blue1_1" />
                    </LinearLayout>


                </androidx.gridlayout.widget.GridLayout>

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

                    <!--                                        <Button-->
                    <!--                                            android:id="@+id/dialog_tire_update_save1"-->
                    <!--                                            android:layout_width="match_parent"-->
                    <!--                                            android:layout_height="55dp"-->
                    <!--                                            android:layout_marginTop="12dp"-->
                    <!--                                            android:layout_marginBottom="12dp"-->
                    <!--                                            android:layout_weight="1"-->
                    <!--                                            android:background="@drawable/bg_button_blue"-->
                    <!--                                            android:text="保存信息并换胎"-->
                    <!--                                            android:textColor="@color/white"-->
                    <!--                                            android:textSize="16sp"-->
                    <!--                                            android:textStyle="bold" />-->

                    <Button
                        android:id="@+id/dialog_tire_update_save"
                        android:layout_width="match_parent"
                        android:layout_height="55dp"
                        android:layout_marginStart="5dp"
                        android:layout_marginTop="12dp"
                        android:layout_marginBottom="12dp"
                        android:layout_weight="1"
                        android:background="@drawable/bg_button_blue"
                        android:text="保存当前轮位"
                        android:textColor="@color/white"
                        android:textSize="16sp"
                        android:textStyle="bold" />

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="100dp" />


                </LinearLayout>


            </LinearLayout>
        </ScrollView>

    </LinearLayout>
</layout>