<?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.quansu.heifengwuliu.utils.MUiSwitch" />

        <variable
            name="vm"
            type="com.quansu.heifengwuliu.vmodel.RegisterVModel" />

    </data >

    <LinearLayout
        android:name="com.ysnows.login.activity.LoginActivity"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/white"
        android:fitsSystemWindows="true"
        android:orientation="vertical"
        tools:context="com.quansu.heifengwuliu.activity.RegisterActivity" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="140dp"
            android:layout_marginTop="12dp"
            android:layout_marginBottom="12dp"
            android:gravity="center"
            android:orientation="vertical" >

            <ImageView
                android:id="@+id/img_avatar"
                android:layout_width="70dp"
                android:layout_height="70dp"
                android:src="@mipmap/ic_launcher" />
            <TextView
                android:layout_width="wrap_content"
                android:layout_marginTop="10dp"
                android:text="物流平台"
                android:textSize="15sp"
                android:textColor="#4B3200"
                android:layout_height="wrap_content">
            </TextView>

        </LinearLayout >


        <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout
            android:layout_width="match_parent"
            android:layout_height="48dp"
            android:layout_marginLeft="35dp"
            android:layout_marginRight="35dp"
            android:gravity="center_vertical"
            android:paddingStart="@dimen/dp_14"
            android:paddingEnd="@dimen/dp_14"
            app:rv_radius="25dp"
            app:qmui_borderColor="#F4F3F9"
            app:qmui_backgroundColor="#F4F3F9"
            app:rv_stroke_color="@color/color_line_two" >

            <com.ysnows.base.widget.DelEditText
                android:id="@+id/edt_user_name"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@null"
                android:hint="@string/please_input_user_name"
                android:text="@={vm.userName}"
                android:textSize="@dimen/sp_15" />

        </com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout >


        <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout
            android:layout_width="match_parent"
            android:layout_height="48dp"
            android:layout_marginLeft="35dp"
            android:layout_marginRight="35dp"
            android:layout_marginTop="@dimen/dp_16"

            android:gravity="center_vertical"
            android:paddingStart="@dimen/dp_14"
            android:paddingEnd="@dimen/dp_14"
            app:rv_radius="25dp"
            app:qmui_borderColor="#F4F3F9"
            app:qmui_backgroundColor="#F4F3F9"
            app:rv_stroke_color="@color/color_line_two" >

            <com.ysnows.base.widget.DelEditText
                android:id="@+id/edt_user_phone"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@null"
                android:hint="@string/please_input_user_phone"
                android:inputType="phone"
                android:text="@={vm.phone}"
                android:textSize="@dimen/sp_15" />

        </com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout >

        <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout
            android:layout_width="match_parent"
            android:layout_height="48dp"
            android:layout_marginLeft="35dp"
            android:layout_marginTop="@dimen/dp_16"
            android:layout_marginRight="35dp"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            android:paddingStart="@dimen/dp_14"
            android:paddingEnd="@dimen/dp_14"
            app:rv_radius="25dp"
            app:qmui_borderColor="#F4F3F9"
            app:qmui_backgroundColor="#F4F3F9"
            app:rv_stroke_color="@color/color_line_two" >

            <EditText
                android:id="@+id/edt_code"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:background="@null"
                android:hint="@string/please_input_code"
                android:inputType="phone"
                android:text="@={vm.code}"
                android:textSize="@dimen/sp_15" />

            <TextView
                android:id="@+id/btn_get_code"
                android:layout_width="90dp"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:onClick="@{v->vm.getSmsCode(1)}"
                android:paddingTop="@dimen/dp_4"
                android:paddingBottom="@dimen/dp_4"
                android:text="@{vm.codeTip,default=@string/get_sms_code}"
                android:textColor="@color/colorPrimary"
                android:textSize="@dimen/sp_12"
                 />
        </com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout >

        <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout
            android:layout_width="match_parent"
            android:layout_height="48dp"
            android:layout_marginLeft="35dp"
            android:layout_marginTop="@dimen/dp_16"
            android:layout_marginRight="35dp"
            android:gravity="center_vertical"
            android:paddingStart="@dimen/dp_14"
            android:paddingEnd="@dimen/dp_14"
            app:rv_radius="25dp"
            app:qmui_borderColor="#F4F3F9"
            app:qmui_backgroundColor="#F4F3F9"
            app:rv_stroke_color="@color/color_line_two" >

            <TextView
                android:layout_width="wrap_content"
                android:textColor="#353535"
                android:text="@string/your_status"
                android:layout_height="wrap_content">
            </TextView>

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

            <LinearLayout
                android:layout_width="wrap_content"
                android:onClick="@{v->vm.choseType(1)}"

                android:layout_height="wrap_content">

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="20dp"
                    android:src="@{vm.showType ? @drawable/chose_on:@drawable/chose_off }"
                   >

                </ImageView>
                <TextView
                    android:layout_width="wrap_content"
                    android:textColor="#353535"
                    android:text="货主"
                    android:layout_marginStart="10dp"
                    android:layout_height="wrap_content">
                </TextView>

            </LinearLayout>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_marginStart="25dp"
                android:onClick="@{v->vm.choseType(2)}"
                android:layout_height="wrap_content">

                <ImageView
                    android:layout_width="20dp"
                    android:src="@{!vm.showType ? @drawable/chose_on:@drawable/chose_off }"
                    android:layout_height="20dp">

                </ImageView>
                <TextView
                    android:layout_width="wrap_content"
                    android:textColor="#353535"
                    android:text="司机"
                    android:layout_marginStart="10dp"
                    android:layout_height="wrap_content">
                </TextView>

            </LinearLayout>





        </com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout >


        <androidx.cardview.widget.CardView
            android:layout_width="match_parent"
            android:layout_height="45dp"
            android:layout_marginLeft="35dp"
            android:layout_marginTop="40dp"
            android:layout_marginRight="35dp"
            android:background="@color/colorPrimary"
            app:cardBackgroundColor="@color/colorPrimary"
            app:cardCornerRadius="22.5dp"
            app:cardElevation="2dp"
            app:cardPreventCornerOverlap="true" >

            <Button
                android:id="@+id/btn_login"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="#E17E30"
                android:onClick="@{v->vm.register()}"
                android:text="@string/register"
                android:textColor="@color/white"
                android:textSize="@dimen/sp_16" />

        </androidx.cardview.widget.CardView >


        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginTop="10dp"
            android:onClick="@{v->MUiSwitch.INSTANCE.toLogin(vm.view().context())}"
            android:orientation="horizontal">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="已有账号？去"
                android:textColor="#4B3200"
                android:textSize="12sp">

            </TextView>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="登录"
                android:textColor="#EA5169"
                android:textSize="12sp">

            </TextView>


        </LinearLayout>

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

<!--        <com.quansu.heifengwuliu.widget.WidgetPolicy-->
<!--            android:layout_width="match_parent"-->
<!--            android:layout_height="wrap_content"-->
<!--            android:layout_marginBottom="@dimen/dp_8" />-->

    </LinearLayout >
</layout >
