mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-15 23:59:21 -04:00
Offline username validation (avoid typing email when offline enabled)
This commit is contained in:
parent
fe515d5069
commit
c37634ac69
@ -567,8 +567,8 @@ public class PojavLoginActivity extends BaseActivity
|
|||||||
String text = edit2.getText().toString();
|
String text = edit2.getText().toString();
|
||||||
if (text.isEmpty()) {
|
if (text.isEmpty()) {
|
||||||
edit2.setError(getString(R.string.global_error_field_empty));
|
edit2.setError(getString(R.string.global_error_field_empty));
|
||||||
} else if (text.length() <= 2) {
|
} else if (text.length() < 3 || text.length() > 16 || !text.matches("\\w+")) {
|
||||||
edit2.setError(getString(R.string.login_error_short_username));
|
edit2.setError(getString(R.string.login_error_invalid_username));
|
||||||
} else if (new File(Tools.DIR_ACCOUNT_NEW + "/" + text + ".json").exists()) {
|
} else if (new File(Tools.DIR_ACCOUNT_NEW + "/" + text + ".json").exists()) {
|
||||||
edit2.setError(getString(R.string.login_error_exist_username));
|
edit2.setError(getString(R.string.login_error_exist_username));
|
||||||
} else if (!edit3.getText().toString().isEmpty()) {
|
} else if (!edit3.getText().toString().isEmpty()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user