@Override public void setListener() { btn_finish.setOnClickListener(this); edit_agagin_passwrod.setOnFocusChangeListener( new OnEditFocusChangeListener(edit_agagin_passwrod, mContext)); edit_agagin_passwrod.addTextChangedListener( new MyEditTextWatcher(edit_agagin_passwrod, mContext, this)); edit_password.addTextChangedListener(new MyEditTextWatcher(edit_password, mContext, this)); edit_password.setOnFocusChangeListener(new OnEditFocusChangeListener(edit_password, mContext)); }
@Override public void onTextLengthChanged(boolean isBlank) { if (!isBlank) { if (edit_password.getText().toString().length() != 0 && edit_agagin_passwrod.getText().toString().length() != 0) { btn_finish.setEnabled(true); btn_finish.setBackgroundResource(R.drawable.btn_selector); return; } } btn_finish.setEnabled(false); btn_finish.setBackgroundResource(R.drawable.btn_disenable_bg); }
@Override public void onClick(View v) { String passwd = edit_password.getText().toString(); String paswdAgain = edit_agagin_passwrod.getText().toString(); if (!paswdAgain.equals(passwd)) { ToastUtil.showToast("Á½´ÎÊäÈëµÄÃÜÂë²»Ò»ÖÂ", Toast.LENGTH_SHORT); return; } mActivity.getmRegister().setUser_password(passwd); dialog = DialogUtil.createLoadingDialog(mContext, "ÇëÉÔºò"); dialog.show(); userRegister(); }