| | |
| | | |
| | | |
| | | import android.os.Bundle; |
| | | import android.os.CountDownTimer; |
| | | import android.text.Editable; |
| | | import android.text.InputType; |
| | | import android.text.TextUtils; |
| | | import android.text.TextWatcher; |
| | | import android.text.method.HideReturnsTransformationMethod; |
| | | import android.text.method.PasswordTransformationMethod; |
| | | import android.view.View; |
| | | |
| | | import androidx.appcompat.content.res.AppCompatResources; |
| | | import androidx.constraintlayout.widget.ConstraintSet; |
| | | |
| | | import com.hdl.linkpm.sdk.core.exception.HDLException; |
| | | import com.hdl.linkpm.sdk.user.HDLLinkPMUser; |
| | | import com.hdl.linkpm.sdk.user.bean.HDLUserRegionBean; |
| | | import com.hdl.photovoltaic.R; |
| | | import com.hdl.photovoltaic.base.CustomBaseActivity; |
| | | import com.hdl.photovoltaic.config.AppConfigManage; |
| | | import com.hdl.photovoltaic.databinding.ActivityRegisterAccountBinding; |
| | | import com.hdl.photovoltaic.listener.CloudCallBeak; |
| | | import com.hdl.photovoltaic.other.HdlAccountLogic; |
| | | import com.hdl.photovoltaic.other.HdlLogLogic; |
| | | import com.hdl.photovoltaic.other.HdlThreadLogic; |
| | | import com.hdl.photovoltaic.utils.KeyboardStateObserverUtils; |
| | | import com.hdl.photovoltaic.widget.ConfirmationCancelDialog; |
| | | import com.hdl.photovoltaic.widget.ConfirmationTipDialog; |
| | | import com.hdl.photovoltaic.widget.ListDialog; |
| | | |
| | | /** |
| | | * 注册账号界面 |
| | |
| | | public class RegisterAccountActivity extends CustomBaseActivity { |
| | | |
| | | private ActivityRegisterAccountBinding viewBinding; |
| | | |
| | | private boolean isPhoneType = true; |
| | | |
| | | private String mPhoneAccount; |
| | | private String mPhonePsw; |
| | | private String mPhoneConfirmPsw; |
| | | private String mPhoneVerificationCode; |
| | | |
| | | private String mMailAccount; |
| | | private String mMailPsw; |
| | | private String mMailConfirmPsw; |
| | | private String mMailVerificationCode; |
| | | |
| | | private String mUrl = "https://test-gz.hdlcontrol.com"; |
| | | |
| | | |
| | | @Override |
| | | public Object getContentView() { |
| | |
| | | |
| | | |
| | | private void initView() { |
| | | |
| | | viewBinding.registerPhoneTitleIc.accountTitleTv.setText(R.string.home_login_手机号); |
| | | viewBinding.registerPhoneTitleIc.accountTitleTv.setTextSize(20); |
| | | viewBinding.registerPhoneTitleIc.accountTitleTv.setTextColor(getResources().getColor(R.color.text_90000000)); |
| | | viewBinding.registerPhoneTitleIc.lineV.setVisibility(View.VISIBLE); |
| | | |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setText(R.string.home_login_邮箱); |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setTextSize(16); |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setTextColor(getResources().getColor(R.color.text_40000000)); |
| | | viewBinding.registerMailTitleIc.lineV.setVisibility(View.GONE); |
| | | |
| | | switchPhoneOrMailView(); |
| | | } |
| | | |
| | | private void initEvent() { |
| | |
| | | finish(); |
| | | } |
| | | }); |
| | | viewBinding.registerRegionServerRl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | ListDialog listDialog = new ListDialog(_mActivity); |
| | | listDialog.show(); |
| | | listDialog.setOnHDLChinaOnListener(new ListDialog.onHDLChinaListener() { |
| | | @Override |
| | | public void HDLChina() { |
| | | mUrl = "https://china-gateway.hdlcontrol.com"; |
| | | viewBinding.regionTv.setText(listDialog.geHDLChinaText()); |
| | | |
| | | } |
| | | }); |
| | | listDialog.setOnHDLBahrainListener(new ListDialog.onHDLBahrainListener() { |
| | | @Override |
| | | public void HDLBahrain() { |
| | | mUrl = "https://bahrain-gateway.hdlcontrol.com"; |
| | | viewBinding.regionTv.setText(listDialog.getHDLBahrainText()); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | //切换手机号 |
| | | viewBinding.registerPhoneTitleIc.underlineCl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | |
| | | viewBinding.registerPhoneTitleIc.accountTitleTv.setText(R.string.home_login_手机号); |
| | | viewBinding.registerPhoneTitleIc.accountTitleTv.setTextSize(20); |
| | | viewBinding.registerPhoneTitleIc.accountTitleTv.setTextColor(getResources().getColor(R.color.text_90000000)); |
| | | viewBinding.registerPhoneTitleIc.lineV.setVisibility(View.VISIBLE); |
| | | |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setText(R.string.home_login_邮箱); |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setTextSize(16); |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setTextColor(getResources().getColor(R.color.text_40000000)); |
| | | viewBinding.registerMailTitleIc.lineV.setVisibility(View.GONE); |
| | | isPhoneType = true; |
| | | switchPhoneOrMailView(); |
| | | } |
| | | }); |
| | | |
| | | //切换邮箱 |
| | | viewBinding.registerMailTitleIc.underlineCl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | viewBinding.registerPhoneTitleIc.accountTitleTv.setText(R.string.home_login_手机号); |
| | | viewBinding.registerPhoneTitleIc.accountTitleTv.setTextSize(16); |
| | | viewBinding.registerPhoneTitleIc.accountTitleTv.setTextColor(getResources().getColor(R.color.text_40000000)); |
| | | viewBinding.registerPhoneTitleIc.lineV.setVisibility(View.GONE); |
| | | isPhoneType = false; |
| | | switchPhoneOrMailView(); |
| | | } |
| | | }); |
| | | |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setText(R.string.home_login_邮箱); |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setTextSize(20); |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setTextColor(getResources().getColor(R.color.text_90000000)); |
| | | viewBinding.registerMailTitleIc.lineV.setVisibility(View.VISIBLE); |
| | | //输入密码 |
| | | viewBinding.registerPswEt.addTextChangedListener(changePswTextWatcher); |
| | | //密码显示或者隐藏 |
| | | viewBinding.registerPswHideIv.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | if (v.isSelected()) { |
| | | v.setSelected(false); |
| | | viewBinding.registerPswHideIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.hide)); |
| | | viewBinding.registerPswEt.setTransformationMethod(PasswordTransformationMethod.getInstance()); |
| | | |
| | | } else { |
| | | v.setSelected(true); |
| | | viewBinding.registerPswHideIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.show)); |
| | | viewBinding.registerPswEt.setTransformationMethod(HideReturnsTransformationMethod.getInstance()); |
| | | } |
| | | //设置光标位置 |
| | | if (!TextUtils.isEmpty(viewBinding.registerPswEt.getText())) { |
| | | viewBinding.registerPswEt.setSelection(viewBinding.registerPswEt.length()); |
| | | } |
| | | } |
| | | }); |
| | | //输入确认密码 |
| | | viewBinding.registerConfirmPswEt.addTextChangedListener(changeConfirmPswTextWatcher); |
| | | //确认密码显示或者隐藏 |
| | | viewBinding.registerConfirmPswHideIv.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | if (v.isSelected()) { |
| | | v.setSelected(false); |
| | | viewBinding.registerConfirmPswHideIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.hide)); |
| | | viewBinding.registerConfirmPswEt.setTransformationMethod(PasswordTransformationMethod.getInstance()); |
| | | } else { |
| | | v.setSelected(true); |
| | | viewBinding.registerConfirmPswHideIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.show)); |
| | | viewBinding.registerConfirmPswEt.setTransformationMethod(HideReturnsTransformationMethod.getInstance()); |
| | | } |
| | | //设置光标位置 |
| | | if (!TextUtils.isEmpty(viewBinding.registerConfirmPswEt.getText())) { |
| | | viewBinding.registerConfirmPswEt.setSelection(viewBinding.registerConfirmPswEt.length()); |
| | | } |
| | | } |
| | | }); |
| | | //输入手机号或者邮箱 |
| | | viewBinding.registerAccountEt.addTextChangedListener(accountTextWatcher); |
| | | //手机号获取验证码 |
| | | viewBinding.registerPhoneVerificationTv.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | sendVerification(); |
| | | |
| | | } |
| | | }); |
| | | //输入手机验证码 |
| | | viewBinding.registerPhoneVerificationEt.addTextChangedListener(phoneVerificationTextWatcher); |
| | | //邮箱获取验证码 |
| | | viewBinding.registerMailVerificationTv.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | sendVerification(); |
| | | |
| | | } |
| | | }); |
| | | //输入邮箱验证码 |
| | | viewBinding.registerMailVerificationEt.addTextChangedListener(mailVerificationTextWatcher); |
| | | //注册账号 |
| | | viewBinding.registerCompleteTv.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | if (!isLocalCheckAccountAndPassword()) { |
| | | return; |
| | | } |
| | | String account = viewBinding.registerAccountEt.getText().toString(); |
| | | String psw = viewBinding.registerConfirmPswEt.getText().toString(); |
| | | String verification_code; |
| | | if (isPhoneType) { |
| | | verification_code = viewBinding.registerPhoneVerificationEt.getText().toString(); |
| | | } else { |
| | | verification_code = viewBinding.registerMailVerificationEt.getText().toString(); |
| | | } |
| | | HdlAccountLogic.getInstance().registerAccount(isPhoneType, account, psw, verification_code, new CloudCallBeak<Boolean>() { |
| | | @Override |
| | | public void onSuccess(Boolean obj) { |
| | | HdlThreadLogic.runMainThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | ConfirmationTipDialog dialog = new ConfirmationTipDialog(_mActivity); |
| | | dialog.show(); |
| | | dialog.setYesOnclickListener(new ConfirmationCancelDialog.onYesOnclickListener() { |
| | | @Override |
| | | public void Confirm() { |
| | | finish(); |
| | | } |
| | | }); |
| | | } |
| | | }, null, null); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 发送验证码指令 |
| | | */ |
| | | private void sendVerification() { |
| | | |
| | | String account = viewBinding.registerAccountEt.getText().toString(); |
| | | if (TextUtils.isEmpty(account)) { |
| | | if (isPhoneType) { |
| | | viewBinding.textErrorTv.setText(R.string.home_login_phone_null); |
| | | } else { |
| | | viewBinding.textErrorTv.setText(R.string.home_login_mail_null); |
| | | } |
| | | return; |
| | | } |
| | | |
| | | |
| | | //获取账号区域信息 |
| | | HdlAccountLogic.getInstance().regionByAccount(account, new CloudCallBeak<HDLUserRegionBean>() { |
| | | @Override |
| | | public void onSuccess(HDLUserRegionBean obj) { |
| | | //发送消息验证码 |
| | | HdlThreadLogic.toast(RegisterAccountActivity.this, getString(R.string.home_login_already_exists)); |
| | | HdlLogLogic.print("regionByAccount onSuccess==" + obj); |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | //用户不存在才注册 |
| | | if (e != null && e.getCode() == 10010) { |
| | | //设置账号所在区域协议及地址 |
| | | // AppConfigManage.setUserRegionUrl("http://59.41.255.150:7777");//obj.getRegionUrl() |
| | | if (!AppConfigManage.isIsOnlineServer()) { |
| | | //测试环境默认这个域名 |
| | | mUrl = "https://test-gz.hdlcontrol.com"; |
| | | } |
| | | HDLLinkPMUser.getInstance().setUserRegionUrl(mUrl); |
| | | HdlAccountLogic.getInstance().sendVerifyCode(isPhoneType, account, "86", 1, new CloudCallBeak<Boolean>() { |
| | | @Override |
| | | public void onSuccess(Boolean obj) { |
| | | if (isPhoneType) { |
| | | phoneCountDownTimer.start(); |
| | | } else { |
| | | mailCountDownTimer.start(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 初始化手机号计时器 |
| | | */ |
| | | CountDownTimer phoneCountDownTimer = new CountDownTimer(60 * 1000, 1000) { |
| | | @Override |
| | | public void onTick(long millisUntilFinished) { |
| | | long time = (millisUntilFinished / 1000); |
| | | String str = time + "s" + getString(R.string.home_login_psw_verification_repeater); |
| | | viewBinding.registerPhoneVerificationTv.setText(str); |
| | | viewBinding.registerPhoneVerificationTv.setTextColor(getResources().getColor(R.color.text_25000000,null)); |
| | | viewBinding.registerPhoneVerificationTv.setEnabled(false); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onFinish() { |
| | | viewBinding.registerPhoneVerificationTv.setText(getString(R.string.home_login_verification_regain)); |
| | | viewBinding.registerPhoneVerificationTv.setTextColor(getResources().getColor(R.color.text_245EC3,null)); |
| | | viewBinding.registerPhoneVerificationTv.setEnabled(true); |
| | | |
| | | |
| | | } |
| | | }; |
| | | /** |
| | | * 初始化邮箱计时器 |
| | | */ |
| | | CountDownTimer mailCountDownTimer = new CountDownTimer(60 * 1000, 1000) { |
| | | @Override |
| | | public void onTick(long millisUntilFinished) { |
| | | long time = (millisUntilFinished / 1000); |
| | | String str = time + "s" + getString(R.string.home_login_psw_verification_repeater); |
| | | |
| | | viewBinding.registerMailVerificationTv.setText(str); |
| | | viewBinding.registerMailVerificationTv.setTextColor(getResources().getColor(R.color.text_25000000,null)); |
| | | viewBinding.registerMailVerificationTv.setEnabled(false); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onFinish() { |
| | | viewBinding.registerMailVerificationTv.setText(getString(R.string.home_login_verification_regain)); |
| | | viewBinding.registerMailVerificationTv.setTextColor(getResources().getColor(R.color.text_245EC3,null)); |
| | | viewBinding.registerMailVerificationTv.setEnabled(true); |
| | | |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 切换手机号或者邮箱的样式 |
| | | */ |
| | | private void switchPhoneOrMailView() { |
| | | if (isPhoneType) { |
| | | //手机号 |
| | | viewBinding.registerPhoneTitleIc.accountTitleTv.setText(R.string.home_login_phone); |
| | | viewBinding.registerPhoneTitleIc.accountTitleTv.setTextSize(20); |
| | | viewBinding.registerPhoneTitleIc.accountTitleTv.setTextColor(getResources().getColor(R.color.text_90000000,null)); |
| | | viewBinding.registerPhoneTitleIc.lineV.setVisibility(View.VISIBLE); |
| | | |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setText(R.string.home_login_email); |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setTextSize(16); |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setTextColor(getResources().getColor(R.color.text_40000000,null)); |
| | | viewBinding.registerMailTitleIc.lineV.setVisibility(View.GONE); |
| | | |
| | | //输入手机号 |
| | | viewBinding.registerAccountEt.setInputType(InputType.TYPE_CLASS_NUMBER); |
| | | viewBinding.registerAccountEt.setHint(R.string.home_login_input_phone); |
| | | //显示手机号验证码,隐藏邮箱验证码, |
| | | viewBinding.registerPhoneVerificationCodeRl.setVisibility(View.VISIBLE); |
| | | viewBinding.registerMailVerificationCodeRl.setVisibility(View.GONE); |
| | | //记录邮箱账号和密码 |
| | | mMailAccount = viewBinding.registerAccountEt.getText().toString(); |
| | | mMailVerificationCode = viewBinding.registerMailVerificationEt.getText().toString(); |
| | | mMailPsw = viewBinding.registerPswEt.getText().toString(); |
| | | mMailConfirmPsw = viewBinding.registerConfirmPswEt.getText().toString(); |
| | | //显示旧数据 |
| | | viewBinding.registerAccountEt.setText(mPhoneAccount); |
| | | viewBinding.registerPhoneVerificationEt.setText(mPhoneVerificationCode); |
| | | viewBinding.registerPswEt.setText(mPhonePsw); |
| | | viewBinding.registerConfirmPswEt.setText(mPhoneConfirmPsw); |
| | | |
| | | |
| | | } else { |
| | | //邮箱 |
| | | viewBinding.registerPhoneTitleIc.accountTitleTv.setText(R.string.home_login_phone); |
| | | viewBinding.registerPhoneTitleIc.accountTitleTv.setTextSize(16); |
| | | viewBinding.registerPhoneTitleIc.accountTitleTv.setTextColor(getResources().getColor(R.color.text_40000000,null)); |
| | | viewBinding.registerPhoneTitleIc.lineV.setVisibility(View.GONE); |
| | | |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setText(R.string.home_login_email); |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setTextSize(20); |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setTextColor(getResources().getColor(R.color.text_90000000,null)); |
| | | viewBinding.registerMailTitleIc.lineV.setVisibility(View.VISIBLE); |
| | | //输入邮箱 |
| | | viewBinding.registerAccountEt.setInputType(InputType.TYPE_CLASS_TEXT); |
| | | viewBinding.registerAccountEt.setHint(R.string.home_login_input_mail); |
| | | |
| | | //显示箱邮验证码,隐藏手机号验证码, |
| | | viewBinding.registerPhoneVerificationCodeRl.setVisibility(View.GONE); |
| | | viewBinding.registerMailVerificationCodeRl.setVisibility(View.VISIBLE); |
| | | |
| | | //记录手机号和密码 |
| | | mPhoneAccount = viewBinding.registerAccountEt.getText().toString(); |
| | | mPhoneVerificationCode = viewBinding.registerPhoneVerificationEt.getText().toString(); |
| | | mPhonePsw = viewBinding.registerPswEt.getText().toString(); |
| | | mPhoneConfirmPsw = viewBinding.registerConfirmPswEt.getText().toString(); |
| | | //显示旧数据 |
| | | viewBinding.registerAccountEt.setText(mMailAccount); |
| | | viewBinding.registerMailVerificationEt.setText(mMailVerificationCode); |
| | | viewBinding.registerPswEt.setText(mMailPsw); |
| | | viewBinding.registerConfirmPswEt.setText(mMailConfirmPsw); |
| | | |
| | | } |
| | | isCompleteEnabled(); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 校验按钮是否启用 |
| | | */ |
| | | private void isCompleteEnabled() { |
| | | String account = viewBinding.registerAccountEt.getText().toString(); |
| | | String psw1 = viewBinding.registerPswEt.getText().toString(); |
| | | String psw2 = viewBinding.registerConfirmPswEt.getText().toString(); |
| | | String verification_code; |
| | | if (isPhoneType) { |
| | | verification_code = viewBinding.registerPhoneVerificationEt.getText().toString(); |
| | | } else { |
| | | verification_code = viewBinding.registerMailVerificationEt.getText().toString(); |
| | | } |
| | | boolean isEnabled = account.length() > 0 && psw1.length() > 0 && psw2.length() > 0 && verification_code.length() > 0; |
| | | viewBinding.registerCompleteTv.setEnabled(isEnabled); |
| | | } |
| | | |
| | | /** |
| | | * 本地校验输入账号或者密码是否正确 |
| | | */ |
| | | private boolean isLocalCheckAccountAndPassword() { |
| | | String psw1 = viewBinding.registerPswEt.getText().toString(); |
| | | String psw2 = viewBinding.registerConfirmPswEt.getText().toString(); |
| | | if (!psw1.equals(psw2)) { |
| | | viewBinding.textErrorTv.setText(R.string.home_login_psw_unlikeliness); |
| | | return false; |
| | | } |
| | | if (psw1.length() < 6 || psw1.length() > 16) { |
| | | viewBinding.textErrorTv.setText(R.string.home_login_error_6_16_str); |
| | | return false; |
| | | } |
| | | // if (psw2.length() < 6 || psw2.length() > 16) { |
| | | // viewBinding.textErrorTv.setText(R.string.home_login_error_6_16_str); |
| | | // return false; |
| | | // } |
| | | return true; |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | protected void onDestroy() { |
| | | super.onDestroy(); |
| | | if (phoneCountDownTimer != null) { |
| | | phoneCountDownTimer.cancel(); |
| | | phoneCountDownTimer = null; |
| | | } |
| | | if (mailCountDownTimer != null) { |
| | | mailCountDownTimer.cancel(); |
| | | mailCountDownTimer = null; |
| | | } |
| | | viewBinding.registerAccountEt.removeTextChangedListener(accountTextWatcher); |
| | | viewBinding.registerPhoneVerificationEt.removeTextChangedListener(phoneVerificationTextWatcher); |
| | | viewBinding.registerMailVerificationEt.removeTextChangedListener(mailVerificationTextWatcher); |
| | | viewBinding.registerPswEt.removeTextChangedListener(changePswTextWatcher); |
| | | viewBinding.registerConfirmPswEt.removeTextChangedListener(changeConfirmPswTextWatcher); |
| | | } |
| | | |
| | | /** |
| | | * 输入手机号或者邮箱 |
| | | */ |
| | | private final TextWatcher accountTextWatcher = new TextWatcher() { |
| | | @Override |
| | | public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onTextChanged(CharSequence s, int start, int before, int count) { |
| | | isCompleteEnabled(); |
| | | } |
| | | |
| | | @Override |
| | | public void afterTextChanged(Editable s) { |
| | | |
| | | } |
| | | }; |
| | | /** |
| | | * 输入手机验证码 |
| | | */ |
| | | private final TextWatcher phoneVerificationTextWatcher = new TextWatcher() { |
| | | @Override |
| | | public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onTextChanged(CharSequence s, int start, int before, int count) { |
| | | isCompleteEnabled(); |
| | | } |
| | | |
| | | @Override |
| | | public void afterTextChanged(Editable s) { |
| | | |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 邮箱获取验证码 |
| | | */ |
| | | private final TextWatcher mailVerificationTextWatcher = new TextWatcher() { |
| | | @Override |
| | | public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onTextChanged(CharSequence s, int start, int before, int count) { |
| | | isCompleteEnabled(); |
| | | } |
| | | |
| | | @Override |
| | | public void afterTextChanged(Editable s) { |
| | | |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 输入密码 |
| | | */ |
| | | private final TextWatcher changePswTextWatcher = new TextWatcher() { |
| | | @Override |
| | | public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onTextChanged(CharSequence s, int start, int before, int count) { |
| | | isCompleteEnabled(); |
| | | } |
| | | |
| | | @Override |
| | | public void afterTextChanged(Editable s) { |
| | | |
| | | } |
| | | }; |
| | | /** |
| | | * 输入确认密码 |
| | | */ |
| | | private final TextWatcher changeConfirmPswTextWatcher = new TextWatcher() { |
| | | @Override |
| | | public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onTextChanged(CharSequence s, int start, int before, int count) { |
| | | isCompleteEnabled(); |
| | | } |
| | | |
| | | @Override |
| | | public void afterTextChanged(Editable s) { |
| | | |
| | | } |
| | | }; |
| | | } |