Merge pull request #774 from brainynai/passwordMismatchWarning

Added password mismatch warning for intro screen
This commit is contained in:
Jakob Nixdorf 2021-02-26 06:32:12 +01:00 committed by GitHub
commit 2c78ce04cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

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

View file

@ -33,7 +33,9 @@
<string name="intro_slide3_warn_no_password">Please set a password to continue!</string>
<string name="intro_slide3_warn_no_pin">Please set a PIN to continue!</string>
<string name="intro_slide3_warn_confirm_password">Please confirm your password to continue!</string>
<string name="intro_slide3_warn_password_mismatch">Passwords must match!</string>
<string name="intro_slide3_warn_confirm_pin">Please confirm your PIN to continue!</string>
<string name="intro_slide3_warn_pin_mismatch">Pins must match!</string>
<string name="intro_slide4_title">Finished</string>
<string name="intro_slide4_desc">Your settings have been saved, you are now all set to use