From 78ad6540a1c93224700f8251bf4fb9002b8f56a5 Mon Sep 17 00:00:00 2001 From: dankito Date: Fri, 20 Nov 2020 01:44:23 +0100 Subject: [PATCH] Implemented that if selected bank is not supported its name does not get set in edtxtBank and edtxtUserName does not get focused but all text in edtxtBank gets selected, so that it can be easily deleted --- .../ui/android/dialogs/AddAccountDialog.kt | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/AddAccountDialog.kt b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/AddAccountDialog.kt index f187e24a..39792b0d 100644 --- a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/AddAccountDialog.kt +++ b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/AddAccountDialog.kt @@ -168,20 +168,26 @@ open class AddAccountDialog : DialogFragment() { } protected open fun bankSelected(bank: BankInfo) { - selectedBank = bank + val didSelectSupportedBank = bank.supportsFinTs3_0 + + selectedBank = if (didSelectSupportedBank) bank else null justDidSelectBank = true - edtxtBank.text = bank.bankCode + " " + bank.name + if (didSelectSupportedBank) { + edtxtBank.text = bank.bankCode + " " + bank.name + } justDidSelectBank = false - edtxtUserName.requestFocus() - checkIfRequiredDataEnteredOnUiThread() - if (bank.supportsFinTs3_0 == false) { + if (didSelectSupportedBank) { + edtxtUserName.requestFocus() + } + else { showBankDoesNotSupportFinTs30ErrorMessage(bank) + edtxtBank.actualEditText.selectAll() } }