diff --git a/app/src/main/java/app/fedilab/fedilabtube/LoginActivity.java b/app/src/main/java/app/fedilab/fedilabtube/LoginActivity.java index b543ad1..8a873d4 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/LoginActivity.java +++ b/app/src/main/java/app/fedilab/fedilabtube/LoginActivity.java @@ -126,6 +126,16 @@ public class LoginActivity extends AppCompatActivity implements OnRetrievePeertu login_passwd = findViewById(R.id.login_passwd); 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(); + } + } + } + }); LinearLayout connected = findViewById(R.id.connected); LinearLayout not_connected = findViewById(R.id.not_connected);