Fix issue #113 - Android password manager with Peertube

This commit is contained in:
Thomas 2025-03-05 10:38:22 +01:00
parent 848d015fd8
commit 8f641c4071
2 changed files with 6 additions and 7 deletions

View file

@ -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);

View file

@ -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" />
</com.google.android.material.textfield.TextInputLayout>
@ -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" />
</com.google.android.material.textfield.TextInputLayout>