From 96c58ded031b35bfb2f069a72ef414e9db160786 Mon Sep 17 00:00:00 2001 From: Ian McKenzie Date: Tue, 23 Feb 2021 21:18:06 -0500 Subject: [PATCH] Added password mismatch warning for intro screen --- .../flocke/andotp/Activities/IntroScreenActivity.java | 6 ++++++ app/src/main/res/values/strings_intro.xml | 2 ++ 2 files changed, 8 insertions(+) diff --git a/app/src/main/java/org/shadowice/flocke/andotp/Activities/IntroScreenActivity.java b/app/src/main/java/org/shadowice/flocke/andotp/Activities/IntroScreenActivity.java index cc027ed5..f09ad458 100644 --- a/app/src/main/java/org/shadowice/flocke/andotp/Activities/IntroScreenActivity.java +++ b/app/src/main/java/org/shadowice/flocke/andotp/Activities/IntroScreenActivity.java @@ -275,6 +275,7 @@ public class IntroScreenActivity extends IntroActivity { private String lengthWarning = ""; private String noPasswordWarning = ""; private String confirmPasswordWarning = ""; + private String passwordMismatchWarning = ""; private TextView desc = null; private Spinner selection = null; @@ -432,6 +433,7 @@ public class IntroScreenActivity extends IntroActivity { lengthWarning = getString(R.string.settings_label_short_password, minLength); noPasswordWarning = getString(R.string.intro_slide3_warn_no_password); confirmPasswordWarning = getString(R.string.intro_slide3_warn_confirm_password); + passwordMismatchWarning = getString(R.string.intro_slide3_warn_password_mismatch); focusOnPasswordInput(); } @@ -458,6 +460,7 @@ public class IntroScreenActivity extends IntroActivity { lengthWarning = getString(R.string.settings_label_short_pin, minLength); noPasswordWarning = getString(R.string.intro_slide3_warn_no_pin); confirmPasswordWarning = getString(R.string.intro_slide3_warn_confirm_pin); + passwordMismatchWarning = getString(R.string.intro_slide3_warn_pin_mismatch); focusOnPasswordInput(); } @@ -506,6 +509,9 @@ public class IntroScreenActivity extends IntroActivity { if (! confirm.isEmpty() && confirm.equals(password)) { hideWarning(); return true; + } else if (! confirm.isEmpty() && ! confirm.equals(password)) { + updateWarning(passwordMismatchWarning); + return false; } else { updateWarning(confirmPasswordWarning); return false; diff --git a/app/src/main/res/values/strings_intro.xml b/app/src/main/res/values/strings_intro.xml index ff465dbe..d7584a0d 100644 --- a/app/src/main/res/values/strings_intro.xml +++ b/app/src/main/res/values/strings_intro.xml @@ -33,7 +33,9 @@ Please set a password to continue! Please set a PIN to continue! Please confirm your password to continue! + Passwords must match! Please confirm your PIN to continue! + Pins must match! Finished Your settings have been saved, you are now all set to use