From 628e62d2ac224b84a5b7f844d111676eda9ee3c4 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 4 Jul 2020 18:07:01 +0200 Subject: [PATCH] CLean up --- .../java/app/fedilab/fedilabtube/LoginActivity.java | 10 ++++++++++ 1 file changed, 10 insertions(+) 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);