1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
editPassword1 = (EditText)findViewById(id.editPassword);
editPassword1.addTextChangedListener(new TextWatcher(){
@Override
public void afterTextChanged(Editable s) {
checkPass1 = String.valueOf(editPassword1.getText());
checkPass2 = String.valueOf(editPassword2.getText());
if (checkPass1 == checkPass2) {
textPasswordInfo.setText(R.string.textPasswordInfo_Ok);
passwordOk = true;
}
else {
textPasswordInfo.setText(R.string.textPasswordInfo);
passwordOk = false;
Toast.makeText(getBaseContext(), "pas pareille " + checkPass1 + " " + checkPass2, Toast.LENGTH_SHORT).show();
}
if (playerNameOk && passwordOk && emailOk){
buttonNext.setEnabled(true);
}
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after){
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
});
editPassword2 = (EditText)findViewById(id.editPassword);
editPassword2.addTextChangedListener(new TextWatcher(){
@Override
public void afterTextChanged(Editable s) {
checkPass1 = String.valueOf(editPassword1.getText());
checkPass2 = String.valueOf(editPassword2.getText());
if (checkPass1 == checkPass2) {
textPasswordInfo.setText(R.string.textPasswordInfo_Ok);
passwordOk = true;
}
else {
textPasswordInfo.setText(R.string.textPasswordInfo);
passwordOk = false;
Toast.makeText(getBaseContext(), "pas pareille " + checkPass1 + " " + checkPass2, Toast.LENGTH_SHORT).show();
}
if (playerNameOk && passwordOk && emailOk){
buttonNext.setEnabled(true);
}
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after){
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
}); |
Partager