| | |
| | | import com.hdl.photovoltaic.widget.ConfirmationCancelDialog; |
| | | import com.hdl.photovoltaic.widget.ConfirmationTipDialog; |
| | | import com.hdl.photovoltaic.widget.ListDialog; |
| | | import com.hdl.sdk.link.common.utils.ThreadToolUtils; |
| | | |
| | | /** |
| | | * 注册账号界面 |
| | |
| | | }); |
| | | |
| | | //输入密码 |
| | | viewBinding.registerPswEt.addTextChangedListener(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) { |
| | | |
| | | } |
| | | }); |
| | | viewBinding.registerPswEt.addTextChangedListener(changePswTextWatcher); |
| | | //密码显示或者隐藏 |
| | | viewBinding.registerPswHideIv.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | |
| | | } |
| | | }); |
| | | //输入确认密码 |
| | | viewBinding.registerConfirmPswEt.addTextChangedListener(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) { |
| | | |
| | | } |
| | | }); |
| | | viewBinding.registerConfirmPswEt.addTextChangedListener(changeConfirmPswTextWatcher); |
| | | //确认密码显示或者隐藏 |
| | | viewBinding.registerConfirmPswHideIv.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | |
| | | } |
| | | }); |
| | | //输入手机号或者邮箱 |
| | | viewBinding.registerAccountEt.addTextChangedListener(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) { |
| | | |
| | | } |
| | | }); |
| | | viewBinding.registerAccountEt.addTextChangedListener(accountTextWatcher); |
| | | //手机号获取验证码 |
| | | viewBinding.registerPhoneVerificationTv.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | |
| | | } |
| | | }); |
| | | //输入手机验证码 |
| | | viewBinding.registerPhoneVerificationEt.addTextChangedListener(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) { |
| | | |
| | | } |
| | | }); |
| | | viewBinding.registerPhoneVerificationEt.addTextChangedListener(phoneVerificationTextWatcher); |
| | | //邮箱获取验证码 |
| | | viewBinding.registerMailVerificationTv.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | |
| | | } |
| | | }); |
| | | //输入邮箱验证码 |
| | | viewBinding.registerMailVerificationEt.addTextChangedListener(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) { |
| | | |
| | | } |
| | | }); |
| | | viewBinding.registerMailVerificationEt.addTextChangedListener(mailVerificationTextWatcher); |
| | | //注册账号 |
| | | viewBinding.registerCompleteTv.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | |
| | | private void switchPhoneOrMailView() { |
| | | if (isPhoneType) { |
| | | //手机号 |
| | | viewBinding.registerPhoneTitleIc.accountTitleTv.setText(R.string.home_login_手机号); |
| | | viewBinding.registerPhoneTitleIc.accountTitleTv.setText(R.string.home_login_phone); |
| | | 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.setText(R.string.home_login_email); |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setTextSize(16); |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setTextColor(getResources().getColor(R.color.text_40000000)); |
| | | viewBinding.registerMailTitleIc.lineV.setVisibility(View.GONE); |
| | | |
| | | //输入手机号 |
| | | viewBinding.registerAccountEt.setInputType(InputType.TYPE_CLASS_NUMBER); |
| | | viewBinding.registerAccountEt.setHint(R.string.home_login_请输入手机号); |
| | | viewBinding.registerAccountEt.setHint(R.string.home_login_input_phone); |
| | | //显示手机号验证码,隐藏邮箱验证码, |
| | | viewBinding.registerPhoneVerificationCodeRl.setVisibility(View.VISIBLE); |
| | | viewBinding.registerMailVerificationCodeRl.setVisibility(View.GONE); |
| | |
| | | |
| | | } else { |
| | | //邮箱 |
| | | viewBinding.registerPhoneTitleIc.accountTitleTv.setText(R.string.home_login_手机号); |
| | | viewBinding.registerPhoneTitleIc.accountTitleTv.setText(R.string.home_login_phone); |
| | | viewBinding.registerPhoneTitleIc.accountTitleTv.setTextSize(16); |
| | | viewBinding.registerPhoneTitleIc.accountTitleTv.setTextColor(getResources().getColor(R.color.text_40000000)); |
| | | viewBinding.registerPhoneTitleIc.lineV.setVisibility(View.GONE); |
| | | |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setText(R.string.home_login_邮箱); |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setText(R.string.home_login_email); |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setTextSize(20); |
| | | viewBinding.registerMailTitleIc.accountTitleTv.setTextColor(getResources().getColor(R.color.text_90000000)); |
| | | viewBinding.registerMailTitleIc.lineV.setVisibility(View.VISIBLE); |
| | |
| | | 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) { |
| | | |
| | | } |
| | | }; |
| | | } |