Showing an error message if selected bank does not support FinTS 3.0

This commit is contained in:
dankl 2019-12-31 00:44:43 +01:00 committed by dankito
parent 9e41fa2cac
commit 149d409dbc
2 changed files with 16 additions and 0 deletions

View File

@ -183,6 +183,21 @@ open class AddAccountDialog : DialogFragment() {
edtxtBankCode.clearListSelection() edtxtBankCode.clearListSelection()
checkIfRequiredDataEnteredOnUiThread() checkIfRequiredDataEnteredOnUiThread()
if (bank.supportsFinTs3_0 == false) {
showBankDoesNotSupportFinTs30ErrorMessage(bank)
}
}
private fun showBankDoesNotSupportFinTs30ErrorMessage(bank: BankInfo) {
activity?.let { context ->
val errorMessage = context.getString(R.string.dialog_add_account_bank_does_not_support_fints_3_error_message, bank.name)
AlertDialog.Builder(context)
.setMessage(errorMessage)
.setPositiveButton(android.R.string.ok) { dialog, _ -> dialog.dismiss() }
.show()
}
} }
protected open fun checkIfRequiredDataEnteredOnUiThread() { protected open fun checkIfRequiredDataEnteredOnUiThread() {

View File

@ -29,6 +29,7 @@
<string name="dialog_add_account_enter_customer_id">Customer Id:</string> <string name="dialog_add_account_enter_customer_id">Customer Id:</string>
<string name="dialog_add_account_enter_pin">Pin:</string> <string name="dialog_add_account_enter_pin">Pin:</string>
<string name="dialog_add_account_add">Add</string> <string name="dialog_add_account_add">Add</string>
<string name="dialog_add_account_bank_does_not_support_fints_3_error_message">%s does not support FinTS 3.0 and therefore cannot be used in this application.</string>
<string name="dialog_add_account_message_could_not_add_account">Could not add account: %s</string> <string name="dialog_add_account_message_could_not_add_account">Could not add account: %s</string>
<string name="dialog_add_account_message_successfully_added_account"> <string name="dialog_add_account_message_successfully_added_account">
Successfully added account. Successfully added account.