code

code


final String email = signInEmail.getText().toString().trim();
final String emailPattern = "[a-zA-Z0-9._-]+@[a-z]+\\.+[a-z]+";
final String password = signInPassword.getText().toString().trim();
//final String passwordPattern = "^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=\\S+$).{8,}$"; //(?=.*[@#$%^&+=])
final String passwordPattern = "^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,64}$"; //(?=.*[@#$%^&+=])


if (email.matches(emailPattern) && password.matches(passwordPattern))
{
    requestLogin(email,password);
}

else if (!email.matches(emailPattern)) {
    showSnackBar("Please enter a valid email \n (for example mail@mail.com)");
}
else if (!password.matches(passwordPattern)) {
    showSnackBar("Enter the correct password");
}
else
    showSnackBar("Check the correctness of data entry");