登录注册接口
283
app/src/main/java/com/kyzy/bazi/login/RegisterActivity.java
Normal file
@@ -0,0 +1,283 @@
|
|||||||
|
package com.kyzy.bazi.login;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.CountDownTimer;
|
||||||
|
import android.text.SpannableString;
|
||||||
|
import android.text.Spanned;
|
||||||
|
import android.text.TextPaint;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.text.method.LinkMovementMethod;
|
||||||
|
import android.text.style.ClickableSpan;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
import com.gyf.immersionbar.ImmersionBar;
|
||||||
|
import com.kyzy.bazi.AppConfig;
|
||||||
|
import com.kyzy.bazi.R;
|
||||||
|
import com.kyzy.bazi.base.BaseActivity;
|
||||||
|
import com.kyzy.bazi.base.entity.MineUserInfoBean;
|
||||||
|
import com.kyzy.bazi.databinding.RegisterLayoutBinding;
|
||||||
|
import com.kyzy.bazi.login.entity.LoginEntity;
|
||||||
|
import com.kyzy.bazi.login.mvp.LoginContract;
|
||||||
|
import com.kyzy.bazi.login.mvp.LoginImpl;
|
||||||
|
import com.kyzy.bazi.login.mvp.LoginPresenter;
|
||||||
|
import com.kyzy.bazi.mine.WebviewUserAgreement;
|
||||||
|
import com.kyzy.bazi.network.BaseBean;
|
||||||
|
import com.kyzy.bazi.utils.click.ClickUtil;
|
||||||
|
import com.kyzy.bazi.utils.number.PhoneNumberUtils;
|
||||||
|
import com.kyzy.bazi.utils.show.ToastUtil;
|
||||||
|
|
||||||
|
import butterknife.OnClick;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author fengxiaoyang
|
||||||
|
* @date 2026/11/5
|
||||||
|
* @description 手机号注册页
|
||||||
|
*/
|
||||||
|
public class RegisterActivity extends BaseActivity<RegisterLayoutBinding, LoginPresenter>
|
||||||
|
implements LoginContract.LoginView {
|
||||||
|
public static final String EXTRA_PHONE = "extra_phone";
|
||||||
|
|
||||||
|
private boolean mAgreementChecked = false;
|
||||||
|
private boolean mCountingDown = false;
|
||||||
|
private CountDownTimer mCountDownTimer;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LoginPresenter createPresenter() {
|
||||||
|
return new LoginPresenter(new LoginImpl());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initData(Bundle savedInstanceState) {
|
||||||
|
super.initData(savedInstanceState);
|
||||||
|
ImmersionBar.with(this)
|
||||||
|
.statusBarView(viewBinding.statusBarView)
|
||||||
|
.statusBarColor(R.color.white)
|
||||||
|
.statusBarDarkFont(true)
|
||||||
|
.init();
|
||||||
|
viewBinding.includeTitle.tvTitle.setText("注册账号");
|
||||||
|
viewBinding.includeTitle.imgBack.setOnClickListener(v -> finish());
|
||||||
|
ClickUtil.addClickPart(viewBinding.checkboxRead, 100);
|
||||||
|
initAgreement();
|
||||||
|
initCountDownTimer();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化用户协议和隐私政策链接
|
||||||
|
*/
|
||||||
|
private void initAgreement() {
|
||||||
|
TextView tvAgreement = viewBinding.tvAgreementFull;
|
||||||
|
String content = "我已阅读并同意星语明灯《用户协议》、《隐私政策》";
|
||||||
|
SpannableString spannableString = new SpannableString(content);
|
||||||
|
|
||||||
|
ClickableSpan userAgreementSpan = new ClickableSpan() {
|
||||||
|
@Override
|
||||||
|
public void onClick(@NonNull View widget) {
|
||||||
|
openAgreement(WebviewUserAgreement.AGREEMENT_CODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateDrawState(@NonNull TextPaint ds) {
|
||||||
|
super.updateDrawState(ds);
|
||||||
|
ds.setColor(ContextCompat.getColor(mContext, R.color.color_zhu));
|
||||||
|
ds.setUnderlineText(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
int agreementStart = content.indexOf("《用户协议》");
|
||||||
|
spannableString.setSpan(userAgreementSpan, agreementStart,
|
||||||
|
agreementStart + "《用户协议》".length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
|
|
||||||
|
ClickableSpan privacyPolicySpan = new ClickableSpan() {
|
||||||
|
@Override
|
||||||
|
public void onClick(@NonNull View widget) {
|
||||||
|
openAgreement(WebviewUserAgreement.PRIVACY_CODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateDrawState(@NonNull TextPaint ds) {
|
||||||
|
super.updateDrawState(ds);
|
||||||
|
ds.setColor(ContextCompat.getColor(mContext, R.color.color_zhu));
|
||||||
|
ds.setUnderlineText(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
int privacyStart = content.indexOf("《隐私政策》");
|
||||||
|
spannableString.setSpan(privacyPolicySpan, privacyStart,
|
||||||
|
privacyStart + "《隐私政策》".length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
|
|
||||||
|
tvAgreement.setText(spannableString);
|
||||||
|
tvAgreement.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openAgreement(int agreementCode) {
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putInt("from_requse_code", agreementCode);
|
||||||
|
goToWihoutNoPresent(mContext, WebviewUserAgreement.class, bundle);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OnClick({R.id.tv_get_code, R.id.tv_register_confirm, R.id.checkbox_read})
|
||||||
|
public void onClick(View v) {
|
||||||
|
switch (v.getId()) {
|
||||||
|
case R.id.checkbox_read:
|
||||||
|
mAgreementChecked = !mAgreementChecked;
|
||||||
|
viewBinding.checkboxRead.setChecked(mAgreementChecked);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case R.id.tv_get_code:
|
||||||
|
getPhoneCode();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case R.id.tv_register_confirm:
|
||||||
|
submitRegister();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getPhoneCode() {
|
||||||
|
String phone = viewBinding.edPhoneInput.getText().toString().trim();
|
||||||
|
if (!isValidPhone(phone)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setGetCodeEnabled(false);
|
||||||
|
showLoadingDialog();
|
||||||
|
mPresenter.getRegisterPhoneCode(phone);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void submitRegister() {
|
||||||
|
String phone = viewBinding.edPhoneInput.getText().toString().trim();
|
||||||
|
if (!isValidPhone(phone)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String code = viewBinding.edCodeInput.getText().toString().trim();
|
||||||
|
if (!TextUtils.isDigitsOnly(code) || code.length() != 6) {
|
||||||
|
ToastUtil.showShort(mContext, "请输入 6 位数字验证码");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String password = viewBinding.edPasswordInput.getText().toString();
|
||||||
|
if (!password.matches(AppConfig.PSD_REGEX)) {
|
||||||
|
ToastUtil.showShort(mContext, "密码需为 8-20 位,且包含大小写字母和数字");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String confirmPassword = viewBinding.edConfirmPasswordInput.getText().toString();
|
||||||
|
if (!password.equals(confirmPassword)) {
|
||||||
|
ToastUtil.showShort(mContext, "两次输入的密码不一致");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!mAgreementChecked) {
|
||||||
|
ToastUtil.showShort(mContext, "请勾选服务协议");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String visCode = viewBinding.edInviteCodeInput.getText().toString().trim();
|
||||||
|
showLoadingDialog();
|
||||||
|
mPresenter.register(phone, code, password, visCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isValidPhone(String phone) {
|
||||||
|
if (TextUtils.isEmpty(phone)) {
|
||||||
|
ToastUtil.showShort(mContext, "手机号不能为空");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!PhoneNumberUtils.checkPhoneNum(phone)) {
|
||||||
|
ToastUtil.showShort(mContext, "请输入正确的手机号");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initCountDownTimer() {
|
||||||
|
mCountDownTimer = new CountDownTimer(60000, 1000) {
|
||||||
|
@Override
|
||||||
|
public void onTick(long millisUntilFinished) {
|
||||||
|
viewBinding.tvGetCode.setText((millisUntilFinished / 1000) + "秒后重发");
|
||||||
|
setGetCodeEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFinish() {
|
||||||
|
mCountingDown = false;
|
||||||
|
viewBinding.tvGetCode.setText("获取验证码");
|
||||||
|
setGetCodeEnabled(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setGetCodeEnabled(boolean enabled) {
|
||||||
|
viewBinding.tvGetCode.setEnabled(enabled);
|
||||||
|
viewBinding.tvGetCode.setClickable(enabled);
|
||||||
|
viewBinding.tvGetCode.setTextColor(ContextCompat.getColor(mContext,
|
||||||
|
enabled ? R.color.color_zhu : R.color.color_c8c8c8));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getPhoneCodeSuccess(BaseBean bean) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
hideDialogLoading();
|
||||||
|
ToastUtil.showShort(mContext, "验证码已发送至手机");
|
||||||
|
mCountingDown = true;
|
||||||
|
mCountDownTimer.cancel();
|
||||||
|
mCountDownTimer.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerSuccess(BaseBean bean) {
|
||||||
|
hideDialogLoading();
|
||||||
|
ToastUtil.showShort(mContext, "注册成功");
|
||||||
|
Intent data = new Intent();
|
||||||
|
data.putExtra(EXTRA_PHONE, viewBinding.edPhoneInput.getText().toString().trim());
|
||||||
|
setResult(RESULT_OK, data);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loginSuccess(LoginEntity entity) {
|
||||||
|
// 注册页无需响应登录成功回调
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void userInfoLoadSuccess(MineUserInfoBean bean) {
|
||||||
|
// 注册页无需响应资料加载回调
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void userInfoLoadFailed(String message) {
|
||||||
|
// 注册页无需响应资料加载失败回调
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showError(String message) {
|
||||||
|
hideDialogLoading();
|
||||||
|
if (!mCountingDown) {
|
||||||
|
viewBinding.tvGetCode.setText("获取验证码");
|
||||||
|
setGetCodeEnabled(true);
|
||||||
|
}
|
||||||
|
ToastUtil.showShort(mContext, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void logOut(BaseBean bean) {
|
||||||
|
// 注册页无需响应登录失效事件
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
if (mCountDownTimer != null) {
|
||||||
|
mCountDownTimer.cancel();
|
||||||
|
}
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getLayoutResId(Bundle savedInstanceState) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
app/src/main/res/drawable-xhdpi/lanhu_test_icon_code.png
Normal file
|
After Width: | Height: | Size: 634 B |
BIN
app/src/main/res/drawable-xhdpi/lanhu_test_icon_password.png
Normal file
|
After Width: | Height: | Size: 493 B |
BIN
app/src/main/res/drawable-xhdpi/lanhu_test_icon_phone.png
Normal file
|
After Width: | Height: | Size: 418 B |
BIN
app/src/main/res/drawable-xxxhdpi/lanhu_test_icon_back.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
5
app/src/main/res/drawable/lanhu_test_code_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||||
|
<solid android:color="@color/lanhu_test_green" />
|
||||||
|
<corners android:radius="99dp" />
|
||||||
|
</shape>
|
||||||
5
app/src/main/res/drawable/lanhu_test_confirm_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||||
|
<solid android:color="@color/lanhu_test_green" />
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
</shape>
|
||||||
5
app/src/main/res/drawable/lanhu_test_input_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||||
|
<solid android:color="#FFFFFF" />
|
||||||
|
<corners android:radius="99dp" />
|
||||||
|
</shape>
|
||||||
5
app/src/main/res/drawable/login_design_button_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||||
|
<solid android:color="#FF6900" />
|
||||||
|
<corners android:radius="12dp" />
|
||||||
|
</shape>
|
||||||
5
app/src/main/res/drawable/login_design_code_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||||
|
<solid android:color="#FF6900" />
|
||||||
|
<corners android:radius="8dp" />
|
||||||
|
</shape>
|
||||||
4
app/src/main/res/drawable/login_design_email_bg.xml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
|
||||||
|
<solid android:color="#FFF3EA" />
|
||||||
|
</shape>
|
||||||
6
app/src/main/res/drawable/login_design_input_bg.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||||
|
<solid android:color="#FFFFFF" />
|
||||||
|
<stroke android:width="1dp" android:color="#EDEFF2" />
|
||||||
|
<corners android:radius="12dp" />
|
||||||
|
</shape>
|
||||||
209
app/src/main/res/layout/lanhu_test_reset_password_layout.xml
Normal file
@@ -0,0 +1,209 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- 蓝湖临时预览:找回密码,按 393dp 宽设计稿还原。仅布局,未接入业务。 -->
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/lanhu_test_page_bg"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:theme="@android:style/Theme.Material.Light.NoActionBar">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="44dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_back"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:contentDescription="@string/lanhu_test_back"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
android:src="@mipmap/lanhu_test_icon_back" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:fontFamily="sans-serif"
|
||||||
|
android:gravity="center"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:text="@string/lanhu_test_reset_password"
|
||||||
|
android:textColor="#000000"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:fillViewport="true"
|
||||||
|
android:overScrollMode="never">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:descendantFocusability="beforeDescendants"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingBottom="30dp">
|
||||||
|
|
||||||
|
<!-- “注册用户”为本张原稿中的实际文案。 -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="22dp"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:text="@string/lanhu_test_register_user"
|
||||||
|
android:textColor="@color/lanhu_test_text"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginHorizontal="20dp"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
android:background="@drawable/lanhu_test_input_bg"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingHorizontal="20dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/lanhu_test_icon_phone" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/ed_phone_input"
|
||||||
|
style="@style/LanhuTestResetInput"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:hint="@string/lanhu_test_account_hint"
|
||||||
|
android:imeOptions="actionNext"
|
||||||
|
android:inputType="textEmailAddress" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginHorizontal="20dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:background="@drawable/lanhu_test_input_bg"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="20dp"
|
||||||
|
android:paddingEnd="10dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/lanhu_test_icon_code" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/ed_code_input"
|
||||||
|
style="@style/LanhuTestResetInput"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:hint="@string/lanhu_test_code_hint"
|
||||||
|
android:imeOptions="actionNext"
|
||||||
|
android:inputType="number"
|
||||||
|
android:maxLength="6" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_get_code"
|
||||||
|
android:layout_width="101dp"
|
||||||
|
android:layout_height="33dp"
|
||||||
|
android:background="@drawable/lanhu_test_code_bg"
|
||||||
|
android:fontFamily="sans-serif"
|
||||||
|
android:gravity="center"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:text="@string/lanhu_test_get_code"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginHorizontal="20dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:background="@drawable/lanhu_test_input_bg"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingHorizontal="20dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/lanhu_test_icon_password" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/ed_password_input"
|
||||||
|
style="@style/LanhuTestResetInput"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:hint="@string/lanhu_test_password_hint"
|
||||||
|
android:imeOptions="actionNext"
|
||||||
|
android:inputType="textPassword" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginHorizontal="20dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:background="@drawable/lanhu_test_input_bg"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingHorizontal="20dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/lanhu_test_icon_password" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/ed_confirm_password_input"
|
||||||
|
style="@style/LanhuTestResetInput"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:hint="@string/lanhu_test_confirm_password_hint"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
android:inputType="textPassword" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_reset_confirm"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_marginHorizontal="20dp"
|
||||||
|
android:layout_marginTop="40dp"
|
||||||
|
android:background="@drawable/lanhu_test_confirm_bg"
|
||||||
|
android:fontFamily="sans-serif"
|
||||||
|
android:gravity="center"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:text="@string/lanhu_test_confirm"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
|
</LinearLayout>
|
||||||
240
app/src/main/res/layout/register_layout.xml
Normal file
@@ -0,0 +1,240 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<View
|
||||||
|
android:id="@+id/statusBarView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:background="@color/white" />
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_48"
|
||||||
|
android:background="@color/white">
|
||||||
|
|
||||||
|
<include
|
||||||
|
android:id="@+id/include_title"
|
||||||
|
layout="@layout/include_activity_back_layout" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fillViewport="true"
|
||||||
|
android:overScrollMode="never">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingBottom="@dimen/dp_30">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp_20"
|
||||||
|
android:layout_marginTop="@dimen/dp_30"
|
||||||
|
android:text="创建账号"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp_20"
|
||||||
|
android:layout_marginTop="@dimen/dp_8"
|
||||||
|
android:text="使用手机号完成注册"
|
||||||
|
android:textColor="@color/color_gray_tab"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_48"
|
||||||
|
android:layout_marginHorizontal="@dimen/dp_15"
|
||||||
|
android:layout_marginTop="@dimen/dp_30"
|
||||||
|
android:background="@drawable/shape_login_input_bg"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingHorizontal="@dimen/dp_15">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="@dimen/dp_18"
|
||||||
|
android:layout_height="@dimen/dp_18"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@mipmap/icon_phone" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/ed_phone_input"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@null"
|
||||||
|
android:hint="请输入手机号"
|
||||||
|
android:inputType="phone"
|
||||||
|
android:maxLength="20"
|
||||||
|
android:paddingLeft="@dimen/dp_12"
|
||||||
|
android:textSize="15sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_48"
|
||||||
|
android:layout_marginHorizontal="@dimen/dp_15"
|
||||||
|
android:layout_marginTop="@dimen/dp_12"
|
||||||
|
android:background="@drawable/shape_login_input_bg"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingHorizontal="@dimen/dp_15">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="@dimen/dp_18"
|
||||||
|
android:layout_height="@dimen/dp_18"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@mipmap/icon_phone_code" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/ed_code_input"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="2"
|
||||||
|
android:background="@null"
|
||||||
|
android:hint="请输入验证码"
|
||||||
|
android:inputType="number"
|
||||||
|
android:maxLength="6"
|
||||||
|
android:paddingLeft="@dimen/dp_12"
|
||||||
|
android:textSize="15sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_get_code"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1.5"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:text="获取验证码"
|
||||||
|
android:textColor="@color/color_zhu"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_48"
|
||||||
|
android:layout_marginHorizontal="@dimen/dp_15"
|
||||||
|
android:layout_marginTop="@dimen/dp_12"
|
||||||
|
android:background="@drawable/shape_login_input_bg"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingHorizontal="@dimen/dp_15">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/ed_password_input"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@null"
|
||||||
|
android:hint="设置密码"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:maxLength="20"
|
||||||
|
android:paddingLeft="@dimen/dp_4"
|
||||||
|
android:textSize="15sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="@dimen/dp_20"
|
||||||
|
android:layout_marginTop="@dimen/dp_6"
|
||||||
|
android:text="8-20 位,需同时包含大小写字母和数字"
|
||||||
|
android:textColor="@color/color_gray_tab"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_48"
|
||||||
|
android:layout_marginHorizontal="@dimen/dp_15"
|
||||||
|
android:layout_marginTop="@dimen/dp_12"
|
||||||
|
android:background="@drawable/shape_login_input_bg"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingHorizontal="@dimen/dp_15">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/ed_confirm_password_input"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@null"
|
||||||
|
android:hint="请再次输入密码"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:maxLength="20"
|
||||||
|
android:paddingLeft="@dimen/dp_4"
|
||||||
|
android:textSize="15sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_48"
|
||||||
|
android:layout_marginHorizontal="@dimen/dp_15"
|
||||||
|
android:layout_marginTop="@dimen/dp_12"
|
||||||
|
android:background="@drawable/shape_login_input_bg"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingHorizontal="@dimen/dp_15">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/ed_invite_code_input"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@null"
|
||||||
|
android:hint="邀请码(选填)"
|
||||||
|
android:inputType="textVisiblePassword"
|
||||||
|
android:maxLength="32"
|
||||||
|
android:paddingLeft="@dimen/dp_4"
|
||||||
|
android:textSize="15sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_register_confirm"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="@dimen/dp_20"
|
||||||
|
android:layout_marginTop="@dimen/dp_25"
|
||||||
|
android:background="@drawable/shape_login_btn_bg"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingVertical="@dimen/dp_15"
|
||||||
|
android:text="注册"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/realtive_read_finish"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginHorizontal="@dimen/dp_15"
|
||||||
|
android:layout_marginTop="@dimen/dp_25"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/checkbox_read"
|
||||||
|
android:layout_width="@dimen/dp_14"
|
||||||
|
android:layout_height="@dimen/dp_14"
|
||||||
|
android:background="@drawable/select_radio"
|
||||||
|
android:button="@null"
|
||||||
|
android:clickable="false" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_agreement_full"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp_12"
|
||||||
|
android:autoLink="none"
|
||||||
|
android:lineSpacingExtra="4dp"
|
||||||
|
android:textColor="@color/color_gray_tab"
|
||||||
|
android:textSize="11sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
|
</LinearLayout>
|
||||||
BIN
app/src/main/res/mipmap-xhdpi/lanhu_test_icon_back.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/lanhu_test_icon_back.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/lanhu_test_icon_back.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
24
app/src/main/res/values-en/strings.xml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<!-- English translations for login_layout only. -->
|
||||||
|
<string name="login_design_welcome">Welcome back</string>
|
||||||
|
<string name="login_design_points">Get 100 points on registration</string>
|
||||||
|
<string name="login_design_phone">Phone Number</string>
|
||||||
|
<string name="login_design_phone_hint">Please enter your phone number</string>
|
||||||
|
<string name="login_design_code">Verification Code</string>
|
||||||
|
<string name="login_design_code_hint">Please enter the verification code</string>
|
||||||
|
<string name="login_design_get_code">Get code</string>
|
||||||
|
<string name="login_design_password">Password</string>
|
||||||
|
<string name="login_design_password_hint">Please enter your password</string>
|
||||||
|
<string name="login_design_password_login">Sign in with password</string>
|
||||||
|
<string name="login_design_sms_login">Sign in with SMS code</string>
|
||||||
|
<string name="login_design_log_in">Log in</string>
|
||||||
|
<string name="login_design_agreement_description">Agree to the User Agreement and Privacy Policy</string>
|
||||||
|
<string name="login_design_agreement">I have read and agree to the <annotation key="agreement" value="user"><font color="#FF6900">User Agreement</font></annotation> and <annotation key="agreement" value="privacy"><font color="#FF6900">Privacy Policy</font></annotation></string>
|
||||||
|
<string name="login_design_other_methods">Other sign-in methods</string>
|
||||||
|
<string name="login_design_email">Sign in with email</string>
|
||||||
|
<string name="login_design_no_account">Don\'t have an account?</string>
|
||||||
|
<string name="login_design_sign_up">Sign up now</string>
|
||||||
|
<string name="login_design_resend_countdown">Resend in %1$d s</string>
|
||||||
|
<string name="login_design_resend">Resend code</string>
|
||||||
|
</resources>
|
||||||
31
app/src/main/res/values/lanhu_test_reset_password.xml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<color name="lanhu_test_page_bg">#F9F9F9</color>
|
||||||
|
<color name="lanhu_test_text">#222222</color>
|
||||||
|
<color name="lanhu_test_hint">#999999</color>
|
||||||
|
<color name="lanhu_test_green">#00CA9D</color>
|
||||||
|
|
||||||
|
<string name="lanhu_test_back">返回</string>
|
||||||
|
<string name="lanhu_test_reset_password">找回密码</string>
|
||||||
|
<string name="lanhu_test_register_user">注册用户</string>
|
||||||
|
<string name="lanhu_test_account_hint">请输入手机号/邮箱号</string>
|
||||||
|
<string name="lanhu_test_code_hint">请输入验证码</string>
|
||||||
|
<string name="lanhu_test_get_code">获取验证码</string>
|
||||||
|
<string name="lanhu_test_password_hint">请输入密码</string>
|
||||||
|
<string name="lanhu_test_confirm_password_hint">请再次输入密码</string>
|
||||||
|
<string name="lanhu_test_confirm">确定</string>
|
||||||
|
|
||||||
|
<style name="LanhuTestResetInput">
|
||||||
|
<item name="android:background">@null</item>
|
||||||
|
<item name="android:padding">0dp</item>
|
||||||
|
<item name="android:minWidth">0dp</item>
|
||||||
|
<item name="android:minHeight">0dp</item>
|
||||||
|
<item name="android:fontFamily">sans-serif</item>
|
||||||
|
<item name="android:gravity">center_vertical</item>
|
||||||
|
<item name="android:includeFontPadding">false</item>
|
||||||
|
<item name="android:singleLine">true</item>
|
||||||
|
<item name="android:textColor">@color/lanhu_test_text</item>
|
||||||
|
<item name="android:textColorHint">@color/lanhu_test_hint</item>
|
||||||
|
<item name="android:textSize">14sp</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
||||||