From 8062873ca25e2d8975f843a51be21ccac5db6f8f Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sat, 25 Jun 2022 18:30:17 +0200 Subject: [PATCH] hide password --- .../java/com/github/libretube/dialogs/DeleteAccountDialog.kt | 1 + .../java/com/github/libretube/preferences/InstanceSettings.kt | 1 + app/src/main/res/layout/dialog_delete_account.xml | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/libretube/dialogs/DeleteAccountDialog.kt b/app/src/main/java/com/github/libretube/dialogs/DeleteAccountDialog.kt index b84c6e9c0..e9cb5458e 100644 --- a/app/src/main/java/com/github/libretube/dialogs/DeleteAccountDialog.kt +++ b/app/src/main/java/com/github/libretube/dialogs/DeleteAccountDialog.kt @@ -63,6 +63,7 @@ class DeleteAccountDialog : DialogFragment() { RetrofitInstance.api.deleteAccount(token, DeleteUserRequest(password)) } catch (e: Exception) { e.printStackTrace() + return@launchWhenCreated } Toast.makeText(context, R.string.success, Toast.LENGTH_SHORT).show() logout() diff --git a/app/src/main/java/com/github/libretube/preferences/InstanceSettings.kt b/app/src/main/java/com/github/libretube/preferences/InstanceSettings.kt index 9c5157de7..f1d6785b0 100644 --- a/app/src/main/java/com/github/libretube/preferences/InstanceSettings.kt +++ b/app/src/main/java/com/github/libretube/preferences/InstanceSettings.kt @@ -155,6 +155,7 @@ class InstanceSettings : PreferenceFragmentCompat() { } val deleteAccount = findPreference("delete_account") + deleteAccount?.parent?.removePreference(deleteAccount) deleteAccount?.setOnPreferenceClickListener { if (token != "") { val newFragment = DeleteAccountDialog() diff --git a/app/src/main/res/layout/dialog_delete_account.xml b/app/src/main/res/layout/dialog_delete_account.xml index cb6ac0b6d..4e092e4b9 100644 --- a/app/src/main/res/layout/dialog_delete_account.xml +++ b/app/src/main/res/layout/dialog_delete_account.xml @@ -20,7 +20,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/password" - android:inputType="text" + android:inputType="textPassword" android:padding="12dp" />