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

This commit is contained in:
dankito 2020-11-20 01:44:23 +01:00
parent 7e0ab6ec9d
commit 78ad6540a1
1 changed files with 11 additions and 5 deletions

View File

@ -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()
}
}