<?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:binding="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:ignore="RtlHardcoded">

    <data>

        <variable
            name="viewModel"
            type="com.hongyegroup.cpt_auth.mvvm.vm.UserLoginViewModel" />

        <variable
            name="click"
            type="com.hongyegroup.cpt_auth.ui.UserLoginActivity.ClickProxy" />

    </data>

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/white"
        android:overScrollMode="never"
        android:scrollbars="none">

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

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/app_blue"
                android:orientation="vertical">

                <ImageView
                    android:id="@+id/iv_top_img"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:scaleType="centerCrop"
                    android:src="@drawable/auth_login_top_img"
                    app:layout_constraintTop_toTopOf="parent" />

                <View
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:background="@drawable/shape_white_top_round15"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/iv_top_img" />

                <androidx.constraintlayout.utils.widget.ImageFilterView
                    android:id="@+id/iv_login_logo"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@drawable/auth_login_logo"
                    app:layout_constraintBottom_toBottomOf="@id/iv_top_img"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/iv_top_img" />

            </androidx.constraintlayout.widget.ConstraintLayout>


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

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/d_23dp"
                    android:layout_marginTop="@dimen/d_10dp"
                    android:layout_marginRight="@dimen/d_23dp"
                    android:gravity="bottom"
                    android:orientation="horizontal">

                    <com.guadou.lib_baselib.font_text_view.TextViewBold
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="手机验证码登录"
                        android:textColor="@color/black"
                        android:textSize="@{click.isPasswordType?@dimen/d_15sp:@dimen/d_21sp}"
                        android:textStyle="bold"
                        binding:clicks="@{click.changeVerifyCodeType}" />

                    <com.guadou.lib_baselib.font_text_view.TextViewBold
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="@dimen/d_35dp"
                        android:text="密码登录"
                        android:textColor="@color/black"
                        android:textSize="@{click.isPasswordType?@dimen/d_21sp:@dimen/d_15sp}"
                        android:textStyle="bold"
                        binding:clicks="@{click.changePasswordType}"
                        tools:textSize="@dimen/d_21sp" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/d_50dp"
                    android:layout_marginLeft="@dimen/d_35dp"
                    android:layout_marginTop="@dimen/d_20dp"
                    android:layout_marginRight="@dimen/d_35dp"
                    android:gravity="center_vertical"
                    android:orientation="horizontal">

                    <LinearLayout
                        android:layout_width="@dimen/d_55dp"
                        android:layout_height="wrap_content"
                        android:gravity="center_vertical"
                        android:onClick="@{click.selectCountryCode}"
                        android:orientation="horizontal">

                        <com.guadou.lib_baselib.font_text_view.TextViewBold
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:textColor="@color/black"
                            android:textSize="@dimen/d_15sp"
                            binding:text="@{viewModel.mMobileCodeLiveData}"
                            tools:text="+86" />

                        <ImageView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="@dimen/d_8dp"
                            android:src="@drawable/ic_drop_down_gray" />

                    </LinearLayout>

                    <EditText
                        android:id="@+id/et_phone_num"
                        android:layout_width="0dp"
                        android:layout_height="match_parent"
                        android:layout_weight="1"
                        android:background="@null"
                        android:hint="请输入手机号码"
                        android:inputType="phone"
                        android:paddingLeft="@dimen/d_9dp"
                        android:singleLine="true"
                        android:text="@={viewModel.mPhoneNumLD}"
                        android:textColor="@color/black"
                        android:textSize="@dimen/d_14sp"
                        binding:typefaceMedium="@{true}" />

                </LinearLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:layout_marginLeft="@dimen/d_28dp"
                    android:layout_marginRight="@dimen/d_28dp"
                    android:background="@color/light_gray_divider" />

                <!--   密码输入框   -->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/d_50dp"
                    android:layout_marginLeft="@dimen/d_35dp"
                    android:layout_marginTop="@dimen/d_5dp"
                    android:layout_marginRight="@dimen/d_35dp"
                    android:gravity="center_vertical"
                    android:orientation="horizontal"
                    binding:isVisibleGone="@{click.isPasswordType}">

                    <FrameLayout
                        android:layout_width="@dimen/d_55dp"
                        android:layout_height="wrap_content">

                        <ImageView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="@dimen/d_10dp"
                            android:src="@drawable/auth_login_password_icon" />

                    </FrameLayout>

                    <EditText
                        android:id="@+id/et_password"
                        android:layout_width="0dp"
                        android:layout_height="match_parent"
                        android:layout_weight="1"
                        android:background="@null"
                        android:hint="请输入密码"
                        android:inputType="textPassword"
                        android:paddingLeft="@dimen/d_9dp"
                        android:singleLine="true"
                        android:text="@={viewModel.mPasswordLD}"
                        android:textColor="@color/black"
                        android:textSize="@dimen/d_14sp"
                        binding:onKeyEnter="@{click.doLogin}"
                        binding:typefaceMedium="@{true}" />

                    <CheckBox
                        android:id="@+id/cb_psd"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="@dimen/d_10dp"
                        android:button="@drawable/selector_check_password_hide" />

                </LinearLayout>

                <!--   验证码的输入框   -->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/d_35dp"
                    android:layout_marginTop="@dimen/d_5dp"
                    android:layout_marginRight="@dimen/d_35dp"
                    android:gravity="center_vertical"
                    android:orientation="horizontal"
                    android:paddingTop="@dimen/d_15dp"
                    android:paddingBottom="@dimen/d_15dp"
                    binding:isVisibleGone="@{!click.isPasswordType}"
                    tools:visibility="gone">

                    <FrameLayout
                        android:layout_width="@dimen/d_55dp"
                        android:layout_height="wrap_content">

                        <ImageView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="@dimen/d_10dp"
                            android:src="@drawable/auth_login_passcode_icon" />

                    </FrameLayout>

                    <EditText
                        android:id="@+id/et_passcode"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:background="@null"
                        android:hint="请输入验证码"
                        android:inputType="textPassword"
                        android:paddingLeft="@dimen/d_9dp"
                        android:singleLine="true"
                        android:text="@={viewModel.MPassCodeLD}"
                        android:textColor="@color/black"
                        android:textCursorDrawable="@null"
                        android:textSize="@dimen/d_14sp"
                        binding:onKeyEnter="@{click.doLogin}"
                        binding:typefaceMedium="@{true}" />

                    <com.guadou.lib_baselib.font_text_view.TextViewMedium
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="获取验证码"
                        android:textColor="@color/black"
                        android:textSize="@dimen/d_14sp"
                        binding:clicks="@{click.getVerityCode}" />

                </LinearLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:layout_marginLeft="@dimen/d_28dp"
                    android:layout_marginRight="@dimen/d_28dp"
                    android:background="@color/light_gray_divider" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="32dp"
                    android:layout_marginTop="@dimen/d_22dp"
                    android:layout_marginRight="32dp"
                    android:gravity="center_vertical"
                    android:orientation="horizontal">

                    <CheckBox
                        android:id="@+id/cb_agree"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:background="@color/transparent"
                        android:button="@drawable/selector_radio_blue"
                        android:checked="false"
                        android:clickable="true" />

                    <com.guadou.lib_baselib.font_text_view.TextViewMedium
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="@dimen/d_10dp"
                        android:text="已阅读并同意"
                        android:textColor="@color/gray_99" />

                    <com.guadou.lib_baselib.font_text_view.TextViewMedium
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="@dimen/d_6dp"
                        android:text="用户协议"
                        android:textColor="@color/app_blue"
                        binding:clicks="@{click.userAgreement}" />

                    <com.guadou.lib_baselib.font_text_view.TextViewMedium
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="@dimen/d_6dp"
                        android:text="和"
                        android:textColor="@color/gray_99" />

                    <com.guadou.lib_baselib.font_text_view.TextViewMedium
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="@dimen/d_6dp"
                        android:text="隐私协议"
                        android:textColor="@color/app_blue"
                        binding:clicks="@{click.privateAgreement}" />

                </LinearLayout>

                <Button
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/d_45dp"
                    android:layout_marginLeft="@dimen/d_28dp"
                    android:layout_marginTop="@dimen/d_21dp"
                    android:layout_marginRight="@dimen/d_28dp"
                    android:background="@drawable/selector_blue_btn_bg_round5"
                    android:text="登录"
                    android:textColor="@color/white"
                    android:textSize="@dimen/d_17sp"
                    binding:clicks="@{click.doLogin}"
                    binding:typefaceBold="@{true}" />

                <FrameLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/d_28dp"
                    android:layout_marginTop="@dimen/d_15dp"
                    android:layout_marginRight="@dimen/d_28dp">

                    <com.guadou.lib_baselib.font_text_view.TextViewMedium
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="注册账号"
                        android:textColor="@color/black"
                        android:textSize="@dimen/d_14sp"
                        binding:clicks="@{click.registAccount}" />

                    <com.guadou.lib_baselib.font_text_view.TextViewMedium
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="right"
                        android:text="忘记密码"
                        android:textColor="@color/black"
                        android:textSize="@dimen/d_14sp"
                        binding:clicks="@{click.forgotPsd}" />

                </FrameLayout>

                <FrameLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/d_28dp"
                    android:layout_marginTop="@dimen/d_28dp"
                    android:layout_marginRight="@dimen/d_28dp">

                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                        android:src="@drawable/auth_login_xuxian" />

                    <com.guadou.lib_baselib.font_text_view.TextViewMedium
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center|center_vertical"
                        android:text="其它登录方式"
                        android:textColor="@color/gray_99"
                        android:textSize="@dimen/d_12sp" />

                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="right|center_vertical"
                        android:src="@drawable/auth_login_xuxian" />

                </FrameLayout>

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:layout_marginTop="@dimen/d_18dp"
                    android:layout_marginBottom="@dimen/d_25dp"
                    android:orientation="horizontal">

                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:src="@drawable/auth_login_wechat_icon"
                        binding:clicks="@{click.wechatLogin}" />

                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="@dimen/d_45dp"
                        android:src="@drawable/auth_login_qq_icon"
                        binding:clicks="@{click.qqLogin}" />
                </LinearLayout>


            </LinearLayout>

        </LinearLayout>

    </ScrollView>


</layout>
