From a5e098dd1f5ad1a82296ed252d05876eba41abb5 Mon Sep 17 00:00:00 2001 From: ganfra Date: Tue, 7 Nov 2023 16:28:16 +0100 Subject: [PATCH] LockScreen : reduce delay before validation step in setup --- .../lockscreen/impl/setup/pin/SetupPinPresenter.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/setup/pin/SetupPinPresenter.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/setup/pin/SetupPinPresenter.kt index 33bf5ccba2..c5f170404f 100644 --- a/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/setup/pin/SetupPinPresenter.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/setup/pin/SetupPinPresenter.kt @@ -32,6 +32,11 @@ import io.element.android.libraries.core.meta.BuildMeta import kotlinx.coroutines.delay import javax.inject.Inject +/** + * Some time for the ui to refresh before showing confirmation step. + */ +private const val DELAY_BEFORE_CONFIRMATION_STEP_IN_MILLIS = 100L + class SetupPinPresenter @Inject constructor( private val lockScreenConfig: LockScreenConfig, private val pinValidator: PinValidator, @@ -60,8 +65,7 @@ class SetupPinPresenter @Inject constructor( setupPinFailure = pinValidationResult.failure } PinValidator.Result.Valid -> { - // Leave some time for the ui to refresh before showing confirmation - delay(150) + delay(DELAY_BEFORE_CONFIRMATION_STEP_IN_MILLIS) isConfirmationStep = true } }