<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:binding="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">

    <data>

        <variable
            name="viewModel"
            type="com.phlx.anchorcollect.ui.login.LoginVM" />
    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@mipmap/home_bg"
        tools:context=".ui.login.LoginActivity">

        <androidx.appcompat.widget.AppCompatTextView
            android:id="@+id/logo_icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="@dimen/dp_40"
            android:text="@string/app"
            android:textColor="@color/white"
            android:drawablePadding="@dimen/dp_10"
            android:textSize="@dimen/sp_20"
            android:layout_marginTop="@dimen/dp_40"
            binding:layout_constraintBottom_toTopOf="@+id/login_frame"
            binding:layout_constraintLeft_toLeftOf="parent"
            binding:layout_constraintRight_toRightOf="parent"
            binding:layout_constraintTop_toTopOf="parent"/>

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/login_frame"
            android:layout_width="@dimen/dp_300"
            android:layout_height="@dimen/dp_270"
            android:background="@color/white"
            android:layout_marginTop="@dimen/dp_60"
            binding:layout_constraintBottom_toBottomOf="parent"
            binding:layout_constraintEnd_toEndOf="parent"
            binding:layout_constraintStart_toStartOf="parent"
            binding:layout_constraintTop_toTopOf="parent">

            <androidx.appcompat.widget.AppCompatTextView
                android:id="@+id/person_code_tip"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/dp_20"
                android:text="@string/jobNum"
                android:textColor="@color/black"
                android:textSize="@dimen/desc_text_size"
                binding:layout_constraintBaseline_toBaselineOf="@+id/user_et"
                binding:layout_constraintEnd_toStartOf="@+id/user_et"
                binding:layout_constraintStart_toStartOf="parent" />

            <androidx.appcompat.widget.AppCompatEditText
                android:id="@+id/user_et"
                android:layout_width="@dimen/dp_0"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/dp_10"
                android:layout_marginTop="@dimen/dp_20"
                android:layout_marginEnd="@dimen/dp_10"
                android:background="@drawable/input_frame_bg"
                android:hint="@string/pleaseInputUserName"
                android:maxLines="1"
                android:text="@={viewModel.userName}"
                android:textColor="@color/textColor"
                android:textColorHint="@color/textColorHint"
                android:textSize="@dimen/edit_size"
                binding:layout_constraintEnd_toStartOf="@+id/clear_et_img"
                binding:layout_constraintStart_toEndOf="@+id/person_code_tip"
                binding:layout_constraintTop_toTopOf="@+id/login_frame"
                binding:onFocusChangeCommand="@{viewModel.onFocusChangeCommand}" />

            <androidx.appcompat.widget.AppCompatImageView
                android:id="@+id/clear_et_img"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/dp_45"
                android:layout_marginEnd="@dimen/dp_20"
                android:src="@mipmap/ic_delete"
                android:visibility="@{viewModel.clearBtnVisibility}"
                binding:layout_constraintEnd_toEndOf="parent"
                binding:layout_constraintStart_toEndOf="@+id/user_et"
                binding:layout_constraintTop_toTopOf="parent"
                binding:onClickCommand="@{viewModel.clearUserNameOnClickCommand}" />


            <androidx.appcompat.widget.AppCompatTextView
                android:id="@+id/person_pwd_tip"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/dp_10"
                android:text="@string/password"
                android:textColor="@color/black"
                android:textSize="@dimen/desc_text_size"
                binding:layout_constraintBaseline_toBaselineOf="@+id/et_password"
                binding:layout_constraintLeft_toLeftOf="@+id/person_code_tip" />


            <androidx.appcompat.widget.AppCompatEditText
                android:id="@+id/et_password"
                android:layout_width="@dimen/dp_0"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/dp_10"
                android:layout_marginTop="@dimen/dp_10"
                android:layout_marginEnd="@dimen/dp_10"
                android:background="@drawable/input_frame_bg"
                android:hint="@string/pleaseInputPassword"
                android:inputType="textPassword"
                android:maxLines="1"
                android:text="@={viewModel.password}"
                android:textColor="@color/textColor"
                android:textColorHint="@color/textColorHint"
                android:textSize="@dimen/edit_size"
                binding:layout_constraintEnd_toStartOf="@+id/iv_switch_pwd"
                binding:layout_constraintRight_toRightOf="parent"
                binding:layout_constraintStart_toEndOf="@+id/person_pwd_tip"
                binding:layout_constraintTop_toBottomOf="@+id/user_et" />

            <androidx.appcompat.widget.AppCompatImageView
                android:id="@+id/iv_switch_pwd"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/dp_23"
                android:layout_marginEnd="@dimen/dp_20"
                android:src="@mipmap/ic_eye_close"
                binding:layout_constraintEnd_toEndOf="parent"
                binding:layout_constraintStart_toEndOf="@+id/et_password"
                binding:layout_constraintTop_toBottomOf="@+id/user_et"
                binding:onClickCommand="@{viewModel.passwordShowSwitchOnClickCommand}" />


            <RadioGroup
                android:id="@+id/radioGroup"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/dp_21"
                android:orientation="horizontal"
                binding:layout_constraintEnd_toEndOf="parent"
                binding:layout_constraintStart_toStartOf="parent"
                binding:layout_constraintTop_toBottomOf="@+id/et_password"
                binding:onCheckedChangedCommand="@{viewModel.isOnlineCheckedChangeCommand}">


                <RadioButton
                    android:id="@+id/offline"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:checked="true"
                    android:text="@string/offLine"
                    android:textSize="@dimen/desc_text_size" />

                <RadioButton
                    android:id="@+id/online"
                    android:layout_width="wrap_content"
                    android:layout_height="22dp"
                    android:layout_marginStart="@dimen/dp_20"
                    android:layout_weight="1"
                    android:text="@string/onLine"
                    android:textSize="@dimen/desc_text_size" />
            </RadioGroup>


            <androidx.appcompat.widget.AppCompatButton
                android:id="@+id/login_btn"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/dp_20"
                android:layout_marginTop="@dimen/dp_30"
                android:background="@drawable/login_btn_bg"
                android:text="@string/login"
                android:textColor="@color/white"
                android:textSize="@dimen/btn_size"
                binding:layout_constraintLeft_toLeftOf="parent"
                binding:layout_constraintTop_toBottomOf="@+id/radioGroup"
                binding:onClickCommand="@{viewModel.loginOnClickCommand}" />

            <androidx.appcompat.widget.AppCompatButton
                android:id="@+id/exit_btn"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/dp_20"
                android:layout_marginEnd="@dimen/dp_20"
                android:background="@drawable/exit_btn_bg"
                android:text="@string/exit"
                android:textColor="@color/white"
                android:textSize="@dimen/btn_size"
                binding:layout_constraintBaseline_toBaselineOf="@+id/login_btn"
                binding:layout_constraintRight_toRightOf="parent"
                binding:onClickCommand="@{viewModel.loginOutClickCommand}" />


        </androidx.constraintlayout.widget.ConstraintLayout>
    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>