| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layout xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | <layout xmlns:tools="http://schemas.android.com/tools" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | |
| | | <data> |
| | |
| | | name="viewModel" |
| | | type="com.application.zhangshi_app_android.ui.login.LoginActivityViewModel" /> |
| | | </data> |
| | | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:paddingHorizontal="30dp" |
| | | android:background="@color/color_normal_background" |
| | | > |
| | | <LinearLayout |
| | | android:layout_width="0dp" |
| | | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginHorizontal="@dimen/dp_30" |
| | | android:orientation="vertical" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | > |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_bg_home" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="@dimen/dp_165" |
| | | android:background="@drawable/bg_login_home" |
| | | /> |
| | | <androidx.cardview.widget.CardView |
| | | android:layout_width="match_parent" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:cardCornerRadius="@dimen/dp_15" |
| | | android:layout_marginTop="-15dp" |
| | | android:background="@drawable/bg_login_home" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" /> |
| | | |
| | | <androidx.cardview.widget.CardView |
| | | android:id="@+id/cardView" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="-20dp" |
| | | app:cardCornerRadius="15dp" |
| | | app:cardElevation="0dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintEnd_toEndOf="@+id/iv_bg_home" |
| | | app:layout_constraintStart_toStartOf="@+id/iv_bg_home" |
| | | app:layout_constraintTop_toBottomOf="@+id/iv_bg_home" |
| | | > |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/iv_bg_home"> |
| | | |
| | | <RelativeLayout |
| | | android:layout_width="match_parent" |
| | |
| | | android:id="@+id/iv_bg_zhang" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_20" |
| | | android:background="@drawable/bg_login_zhang" |
| | | android:layout_centerHorizontal="true" |
| | | /> |
| | | android:layout_marginTop="18dp" |
| | | android:background="@drawable/bg_login_zhang" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_welcome" |
| | | android:id="@+id/tv_title" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginHorizontal="@dimen/dp_25" |
| | | android:layout_centerHorizontal="true" |
| | | android:layout_marginTop="15dp" |
| | | android:text="欢迎来到张氏APP" |
| | | android:textColor="@color/black" |
| | | android:textSize="@dimen/sp_20" |
| | | android:textStyle="bold" |
| | | android:layout_centerHorizontal="true" |
| | | android:layout_marginVertical="@dimen/dp_20" |
| | | /> |
| | | android:textSize="20sp" |
| | | android:textStyle="bold" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginHorizontal="@dimen/dp_27" |
| | | android:orientation="vertical" |
| | | android:layout_below="@id/tv_welcome" |
| | | > |
| | | android:layout_below="@id/tv_title" |
| | | android:layout_marginHorizontal="27dp" |
| | | android:orientation="vertical"> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_account" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="10dp" |
| | | android:text="账号" |
| | | android:textColor="#FF484848" |
| | | android:textSize="@dimen/sp_12" |
| | | /> |
| | | android:textSize="12sp" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:background="@drawable/shape_ffd9d9d9_8_stroke" |
| | | android:paddingVertical="@dimen/dp_12" |
| | | > |
| | | android:layout_height="40dp" |
| | | android:layout_marginTop="7dp" |
| | | android:background="@drawable/shape_ffd9d9d9_8_stroke"> |
| | | |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:layout_marginStart="@dimen/dp_16" |
| | | android:layout_marginStart="16dp" |
| | | android:background="@null" |
| | | android:hint="请输入账号" |
| | | android:inputType="text" |
| | | android:text="@={viewModel.username}" |
| | | android:textColor="#FF093878" |
| | | android:textSize="@dimen/sp_16" |
| | | android:textColorHint="#FF8F9090" |
| | | /> |
| | | android:textSize="14sp" /> |
| | | </LinearLayout> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_password" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_20" |
| | | android:layout_marginTop="20dp" |
| | | android:text="密码" |
| | | android:textColor="#FF484848" |
| | | android:textSize="@dimen/sp_12" |
| | | /> |
| | | android:textSize="12sp" /> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_password" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="@dimen/dp_7" |
| | | android:paddingVertical="@dimen/dp_12" |
| | | android:layout_height="40dp" |
| | | android:layout_marginTop="2dp" |
| | | android:background="@drawable/shape_ffd9d9d9_8_stroke" |
| | | android:gravity="center" |
| | | android:orientation="horizontal"> |
| | | |
| | | <EditText |
| | | android:id="@+id/et_password" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="16dp" |
| | | android:layout_weight="1" |
| | | android:background="@null" |
| | | android:hint="请输入密码" |
| | | android:inputType="textPassword" |
| | | android:text="@={viewModel.password}" |
| | | android:textColor="#FF093878" |
| | | android:textColorHint="#FF8F9090" |
| | | android:textSize="14sp" |
| | | app:passwordVisibility="@{viewModel.passwordVisibility}" /> |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_password_visibility" |
| | | android:layout_width="16dp" |
| | | android:layout_height="20dp" |
| | | android:layout_marginEnd="12sp" |
| | | android:background="@{viewModel.passwordVisibility?@drawable/ic_password_visible:@drawable/ic_password_invisible}" /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/layout_password_again" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:layout_marginTop="2dp" |
| | | android:background="@drawable/shape_ffd9d9d9_8_stroke" |
| | | android:gravity="center" |
| | | android:orientation="horizontal" |
| | | > |
| | | android:visibility="gone"> |
| | | |
| | | <EditText |
| | | android:id="@+id/et_password_again" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="@dimen/dp_16" |
| | | android:layout_marginStart="16dp" |
| | | android:layout_weight="1" |
| | | android:background="@null" |
| | | android:hint="请再次输入密码" |
| | | android:inputType="textPassword" |
| | | android:text="@={viewModel.againPassword}" |
| | | android:textColor="#FF093878" |
| | | android:textSize="@dimen/sp_16" |
| | | android:hint="请输入账号" |
| | | android:textColorHint="#FF8F9090" |
| | | /> |
| | | android:textSize="14sp" |
| | | app:passwordVisibility="@{viewModel.againPasswordVisibility}" /> |
| | | |
| | | <ImageView |
| | | android:layout_width="@dimen/dp_16" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:layout_marginEnd="@dimen/dp_12" |
| | | android:background="@drawable/ic_password_invisable" /> |
| | | android:id="@+id/iv_password_again_visibility" |
| | | android:layout_width="16dp" |
| | | android:layout_height="20dp" |
| | | android:layout_marginEnd="12sp" |
| | | android:background="@{viewModel.againPasswordVisibility?@drawable/ic_password_visible:@drawable/ic_password_invisible}" /> |
| | | /> |
| | | </LinearLayout> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="20dp" |
| | | android:text="验证码" |
| | | android:textColor="#FF484848" |
| | | android:textSize="@dimen/sp_12" |
| | | android:layout_marginTop="@dimen/dp_20" |
| | | /> |
| | | android:textSize="12sp" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | > |
| | | android:layout_marginTop="2dp" |
| | | android:orientation="horizontal"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/shape_ffd9d9d9_8_stroke" |
| | | android:paddingVertical="@dimen/dp_12" |
| | | android:layout_height="40dp" |
| | | android:layout_weight="6" |
| | | > |
| | | android:background="@drawable/shape_ffd9d9d9_8_stroke"> |
| | | |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:layout_marginStart="@dimen/dp_16" |
| | | android:layout_marginStart="16dp" |
| | | android:background="@null" |
| | | android:hint="请输入验证码" |
| | | android:inputType="number" |
| | | android:text="@={viewModel.value}" |
| | | android:textColor="#FF093878" |
| | | android:textSize="@dimen/sp_16" |
| | | android:textColorHint="#FF8F9090" |
| | | /> |
| | | android:textSize="14sp" /> |
| | | </LinearLayout> |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_captcha" |
| | | android:layout_width="0dp" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginStart="6dp" |
| | | android:layout_weight="4" |
| | | android:layout_marginStart="@dimen/dp_6" |
| | | /> |
| | | app:imageBase64="@{viewModel.captchaImageLiveData.img}" /> |
| | | </LinearLayout> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_login" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/shape_ff093878_10_solid" |
| | | android:text="注册/登录" |
| | | android:textColor="@color/white" |
| | | android:gravity="center" |
| | | android:paddingVertical="@dimen/dp_10" |
| | | android:paddingHorizontal="@dimen/dp_77" |
| | | android:textSize="@dimen/sp_12" |
| | | android:layout_marginVertical="@dimen/dp_27" |
| | | android:layout_height="35dp" |
| | | android:layout_gravity="center" |
| | | /> |
| | | android:layout_marginTop="20dp" |
| | | android:background="@drawable/shape_ff093878_10_solid" |
| | | android:gravity="center" |
| | | android:paddingHorizontal="91dp" |
| | | android:text="登录" |
| | | android:textColor="@color/white" |
| | | android:textSize="12sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_register" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:layout_marginVertical="10dp" |
| | | android:gravity="center" |
| | | android:text="立即注册" |
| | | android:textColor="#FF37AADB" |
| | | android:textSize="10sp" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | |
| | | </RelativeLayout> |
| | | </androidx.cardview.widget.CardView> |
| | | |
| | | </LinearLayout> |
| | | <LinearLayout |
| | | android:id="@+id/layout_wx_login" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:gravity="center_horizontal" |
| | | android:orientation="vertical" |
| | | app:layout_constraintTop_toBottomOf="@+id/cardView"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginVertical="7dp" |
| | | android:gravity="center_vertical"> |
| | | |
| | | <View |
| | | android:layout_width="0dp" |
| | | android:layout_height="0.2dp" |
| | | android:layout_weight="1" |
| | | android:background="#80000000" /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginHorizontal="18dp" |
| | | android:text="第三方登录" |
| | | android:textColor="#80000000" |
| | | android:textSize="10sp" /> |
| | | |
| | | <View |
| | | android:layout_width="0dp" |
| | | android:layout_height="0.2dp" |
| | | android:layout_weight="1" |
| | | android:background="#80000000" /> |
| | | </LinearLayout> |
| | | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/ic_wx_login" /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | </layout> |