allows username when logging in
This commit is contained in:
parent
aaa8281da8
commit
13baaccd81
|
@ -119,21 +119,23 @@ public class LoginActivity extends AppCompatActivity {
|
|||
|
||||
connectionButton = findViewById(R.id.login_button);
|
||||
|
||||
login_uid.setOnFocusChangeListener((v, hasFocus) -> {
|
||||
if (!hasFocus) {
|
||||
if (android.util.Patterns.EMAIL_ADDRESS.matcher(login_uid.getText().toString().trim()).matches()) {
|
||||
String[] emailArray = login_uid.getText().toString().split("@");
|
||||
if (emailArray.length > 1 && Arrays.asList(Helper.openid).contains(emailArray[1])) {
|
||||
connectionButton.callOnClick();
|
||||
if (!BuildConfig.full_instances) {
|
||||
login_uid.setOnFocusChangeListener((v, hasFocus) -> {
|
||||
if (!hasFocus) {
|
||||
if (android.util.Patterns.EMAIL_ADDRESS.matcher(login_uid.getText().toString().trim()).matches()) {
|
||||
String[] emailArray = login_uid.getText().toString().split("@");
|
||||
if (emailArray.length > 1 && Arrays.asList(Helper.openid).contains(emailArray[1])) {
|
||||
connectionButton.callOnClick();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
connectionButton.setOnClickListener(v -> {
|
||||
|
||||
if (!android.util.Patterns.EMAIL_ADDRESS.matcher(login_uid.getText().toString().trim()).matches()) {
|
||||
if (login_uid.getText().toString().contains("@") && !android.util.Patterns.EMAIL_ADDRESS.matcher(login_uid.getText().toString().trim()).matches()) {
|
||||
Toasty.error(LoginActivity.this, getString(R.string.email_error)).show();
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue