From d65b7666550fdda95fcda0d3c1e0d0d0f90047d0 Mon Sep 17 00:00:00 2001 From: dankito Date: Wed, 7 Oct 2020 20:56:18 +0200 Subject: [PATCH] Disabling login button during password check and database decryption --- .../dankito/banking/ui/android/activities/LoginActivity.kt | 4 ++++ ui/BankingAndroidApp/src/main/res/layout/activity_login.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/activities/LoginActivity.kt b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/activities/LoginActivity.kt index 350185c6..2e9aa57f 100644 --- a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/activities/LoginActivity.kt +++ b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/activities/LoginActivity.kt @@ -55,6 +55,8 @@ open class LoginActivity : BaseActivity() { protected open fun checkEnteredPasswordAndLogIn() { + btnLogin.isEnabled = false + val enteredPassword = edtxtLoginPassword.text if (authenticationService.isCorrectUserPassword(enteredPassword)) { @@ -62,6 +64,8 @@ open class LoginActivity : BaseActivity() { navigateToMainActivity() } else { + btnLogin.isEnabled = true + Toast.makeText(this, R.string.activity_login_incorrect_password_entered, Toast.LENGTH_SHORT).show() } } diff --git a/ui/BankingAndroidApp/src/main/res/layout/activity_login.xml b/ui/BankingAndroidApp/src/main/res/layout/activity_login.xml index e74059db..c0778919 100644 --- a/ui/BankingAndroidApp/src/main/res/layout/activity_login.xml +++ b/ui/BankingAndroidApp/src/main/res/layout/activity_login.xml @@ -68,7 +68,7 @@ android:layout_width="@dimen/activity_login_button_login_width" android:layout_height="@dimen/activity_login_button_login_height" android:layout_gravity="end" - android:background="@color/colorAccent" + android:background="@drawable/conditionally_disabled_view_background" android:textColor="@color/textBodyTextColor_Dark" android:text="@string/activity_login_login_button_title" />