From b75fdd00263478548536e4efe582c6f346d4a0f5 Mon Sep 17 00:00:00 2001 From: Joshua Soberg Date: Sat, 30 Jan 2021 11:51:37 -0500 Subject: [PATCH] #740 - Clear text when the user chooses a new authentication type Not clearing was allowing a potentially weird state where you could have alpha characters in a PIN --- .../flocke/andotp/Preferences/CredentialsPreference.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/org/shadowice/flocke/andotp/Preferences/CredentialsPreference.java b/app/src/main/java/org/shadowice/flocke/andotp/Preferences/CredentialsPreference.java index 881f9695..6d4a621c 100644 --- a/app/src/main/java/org/shadowice/flocke/andotp/Preferences/CredentialsPreference.java +++ b/app/src/main/java/org/shadowice/flocke/andotp/Preferences/CredentialsPreference.java @@ -287,6 +287,12 @@ public class CredentialsPreference extends DialogPreference public void onItemClick(AdapterView parent, View view, int position, long id) { value = entryValues.get(position); updateLayout(); + clearInputFields(); + } + + private void clearInputFields() { + passwordInput.setText(null); + passwordConfirm.setText(null); } // Needed stub functions