diff --git a/app/src/main/java/app/fedilab/android/peertube/activities/LoginActivity.java b/app/src/main/java/app/fedilab/android/peertube/activities/LoginActivity.java index 60aeb7d8..076bc5b9 100644 --- a/app/src/main/java/app/fedilab/android/peertube/activities/LoginActivity.java +++ b/app/src/main/java/app/fedilab/android/peertube/activities/LoginActivity.java @@ -18,6 +18,7 @@ import static app.fedilab.android.peertube.client.RetrofitPeertubeAPI.updateCred import android.annotation.SuppressLint; import android.content.SharedPreferences; +import android.os.Build; import android.os.Bundle; import android.util.Patterns; import android.view.MenuItem; @@ -63,6 +64,7 @@ public class LoginActivity extends BaseBarActivity { } if (instance == null) { finish(); + return; } if (getSupportActionBar() != null) { @@ -71,7 +73,9 @@ public class LoginActivity extends BaseBarActivity { } binding.loginInstanceContainer.setVisibility(View.VISIBLE); - + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + binding.loginInstance.setImportantForAutofill(View.IMPORTANT_FOR_AUTOFILL_NO); + } binding.loginInstance.setText(instance); if (Helper.isTablet(LoginActivity.this)) { @@ -95,14 +99,11 @@ public class LoginActivity extends BaseBarActivity { return; } binding.loginButton.setEnabled(false); - String instance; - if (binding.loginInstance.getText() == null || binding.loginInstance.getText().toString().trim().length() == 0) { + if (instance == null || instance.trim().isEmpty()) { Toasty.error(LoginActivity.this, getString(R.string.not_valide_instance)).show(); binding.loginButton.setEnabled(true); return; } - instance = binding.loginInstance.getText().toString().trim().toLowerCase(); - if (instance.startsWith("http")) { try { URL url = new URL(instance); diff --git a/app/src/main/res/layouts/peertube/layout/activity_login_peertube.xml b/app/src/main/res/layouts/peertube/layout/activity_login_peertube.xml index 1ad8a340..b97c1ff0 100644 --- a/app/src/main/res/layouts/peertube/layout/activity_login_peertube.xml +++ b/app/src/main/res/layouts/peertube/layout/activity_login_peertube.xml @@ -52,7 +52,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/username_or_email" - android:importantForAutofill="no" android:inputType="textEmailAddress" android:singleLine="true" /> @@ -69,7 +68,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/password" - android:importantForAutofill="no" android:inputType="textPassword" android:singleLine="true" />