From 8d257876a0a887ee28d013a3cef1d9803787442f Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Wed, 20 Feb 2019 16:53:34 -0600 Subject: [PATCH] Fix issue in both PIN and Pattern SecurityLockDialogs, that the error message was not appearing correctly when the user wrongly entered the PIN/Pattern and also the error message was not being cleared once the cooldown timer expired. --- .../fragments/PINSecurityLockDialog.kt | 8 ++------ .../fragments/PatternSecurityLockDialog.kt | 9 +++------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/PINSecurityLockDialog.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/PINSecurityLockDialog.kt index 6ad5442..fb27195 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/PINSecurityLockDialog.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/PINSecurityLockDialog.kt @@ -119,6 +119,7 @@ class PINSecurityLockDialog : BaseSecurityLockDialog() { STEP_SECURITY_LOCK_VERIFY -> { tvTitle.text = getString(R.string.title__re_enter_your_pin) tvSubTitle.text = getString(R.string.msg__enter_your_pin) + tietPIN.isEnabled = true if (incorrectSecurityLockAttempts >= Constants.MAX_INCORRECT_SECURITY_LOCK_ATTEMPTS) { // User has entered the PIN incorrectly too many times val now = System.currentTimeMillis() @@ -126,16 +127,10 @@ class PINSecurityLockDialog : BaseSecurityLockDialog() { tietPIN.setText("") tietPIN.isEnabled = false startContDownTimer() - return } else { resetIncorrectSecurityLockAttemptsAndTime() } } - // This is not in an else statement because we also want to enable the EditText and remove the error - // when the cooldown time has been reached - tietPIN.isEnabled = true - tilPIN.helperText = "" - tilPIN.isErrorEnabled = false } STEP_SECURITY_LOCK_CREATE -> { tvTitle.text = getString(R.string.title__set_bitsy_screen_lock) @@ -160,5 +155,6 @@ class PINSecurityLockDialog : BaseSecurityLockDialog() { override fun onTimerFinished() { setupScreen() + tilPIN.isErrorEnabled = false } } \ No newline at end of file diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/PatternSecurityLockDialog.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/PatternSecurityLockDialog.kt index 0ab2ce3..d9b61ca 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/PatternSecurityLockDialog.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/PatternSecurityLockDialog.kt @@ -148,22 +148,18 @@ class PatternSecurityLockDialog : BaseSecurityLockDialog() { tvSubTitle.text = getString(R.string.msg__enter_your_pattern) btnClear.visibility = View.GONE btnNext.visibility = View.GONE - setMessage("") + patternLockView.isInputEnabled = true + patternLockView.isInStealthMode = true if (incorrectSecurityLockAttempts >= Constants.MAX_INCORRECT_SECURITY_LOCK_ATTEMPTS) { // User has entered the Pattern incorrectly too many times val now = System.currentTimeMillis() if (now <= incorrectSecurityLockTime + Constants.INCORRECT_SECURITY_LOCK_COOLDOWN) { patternLockView.isInputEnabled = false startContDownTimer() - return } else { resetIncorrectSecurityLockAttemptsAndTime() } } - // This is not in an else statement because we also want to enable the EditText and remove the error - // when the cooldown time has been reached - patternLockView.isInputEnabled = true - patternLockView.isInStealthMode = true } STEP_SECURITY_LOCK_CREATE -> { tvTitle.text = getString(R.string.title__set_bitsy_screen_lock) @@ -214,5 +210,6 @@ class PatternSecurityLockDialog : BaseSecurityLockDialog() { override fun onTimerFinished() { setupScreen() + setMessage("") } } \ No newline at end of file