Implemented displaying bank name instead of bank code in AddAccountDialog

This commit is contained in:
dankito 2020-06-24 22:13:41 +02:00
parent eb5fa350f2
commit a5145b0da7
8 changed files with 17 additions and 17 deletions

View File

@ -20,7 +20,7 @@ open class InMemoryBankFinder() : BankFinderBase(), IBankFinder {
}
override fun findBankByNameOrCityForNonEmptyQuery(query: String): List<BankInfo> {
val queryPartsLowerCase = query.toLowerCase().split(" ")
val queryPartsLowerCase = query.toLowerCase().split(" ", "-")
return getBankList().filter { bankInfo ->
checkIfAllQueryPartsMatchBankNameOrCity(queryPartsLowerCase, bankInfo)

View File

@ -74,7 +74,7 @@ open class AddAccountDialog : DialogFragment() {
rootView.edtxtCustomerId.addTextChangedListener(otherEditTextChangedWatcher)
rootView.edtxtPin.addTextChangedListener(otherEditTextChangedWatcher)
addAccountIfEnterPressed(rootView.edtxtBankCode)
addAccountIfEnterPressed(rootView.edtxtBank)
addAccountIfEnterPressed(rootView.edtxtCustomerId)
addAccountIfEnterPressed(rootView.edtxtPin)
@ -88,7 +88,7 @@ open class AddAccountDialog : DialogFragment() {
true
}
Autocomplete.on<BankInfo>(rootView.edtxtBankCode)
Autocomplete.on<BankInfo>(rootView.edtxtBank)
.with(6f)
.with(ColorDrawable(Color.WHITE))
.with(autocompleteCallback)
@ -190,7 +190,7 @@ open class AddAccountDialog : DialogFragment() {
protected open fun bankSelected(bank: BankInfo) {
selectedBank = bank
edtxtBankCode.setText(bank.bankCode)
edtxtBank.setText(bank.name)
edtxtCustomerId.requestFocus()
@ -215,8 +215,8 @@ open class AddAccountDialog : DialogFragment() {
protected open fun checkIfRequiredDataEnteredOnUiThread() {
val requiredDataEntered = selectedBank != null
&& selectedBank?.supportsFinTs3_0 == true
&& edtxtCustomerId.text.toString().isNotEmpty() // TODO: check if it is of length 10?
&& edtxtPin.text.toString().isNotEmpty() // TODO: check if it is of length 5?
&& edtxtCustomerId.text.toString().isNotEmpty()
&& edtxtPin.text.toString().isNotEmpty()
btnAddAccount.isEnabled = requiredDataEntered
}

View File

@ -10,11 +10,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dialog_add_account_field_bottom_margin"
android:hint="@string/dialog_add_account_enter_bank_code"
android:hint="@string/dialog_add_account_enter_bank"
>
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtxtBankCode"
android:id="@+id/edtxtBank"
android:layout_width="match_parent"
android:layout_height="@dimen/dialog_add_account_edit_text_height"
android:inputType="text"

View File

@ -32,7 +32,7 @@
<string name="fragment_home_could_not_retrieve_account_transactions">Kontoumsätze für \'%1$s\' konnten nicht empfangen werden.\n\nFehlermeldung Ihrer Bank:\n\n%2$s</string>
<string name="fragment_home_transfer_money_to">Neue Überweisung an %s</string>
<string name="dialog_add_account_enter_bank_code">Bankleitzahl (Suche auch mittels Bankname oder Ort):</string>
<string name="dialog_add_account_enter_bank">Bank (Suche auch mittels Bankleitzahl oder Ort):</string>
<string name="dialog_add_account_customer_id_and_password_hint">Geben Sie hier die selben Werte ein wie auf Ihrer Online Banking Webseite:</string>
<string name="dialog_add_account_enter_customer_id">Onlinebanking Login Name:</string>
<string name="dialog_add_account_enter_pin">Onlinebanking Passwort:</string>

View File

@ -32,7 +32,7 @@
<string name="fragment_home_could_not_retrieve_account_transactions">Could not retrieve account transactions for \'%1$s\'.\n\nError message from your bank:\n\n%2$s</string>
<string name="fragment_home_transfer_money_to">Transfer money to %s</string>
<string name="dialog_add_account_enter_bank_code">Bank code (find also by bank name or city):</string>
<string name="dialog_add_account_enter_bank">Bank (find also by bank code or city):</string>
<string name="dialog_add_account_customer_id_and_password_hint">Enter the same values here as in your online banking portal</string>
<string name="dialog_add_account_enter_customer_id">Online banking login name:</string>
<string name="dialog_add_account_enter_pin">Online banking password:</string>

View File

@ -35,7 +35,7 @@ account.transactions.table.context.menu.show.transaction.details=Show details
add.account.dialog.title=Add account
add.account.dialog.bank.code.label=Bank code
add.account.dialog.bank.label=Bank (search also by bank code or city)
add.account.dialog.customer.id.and.password.hint=Enter the same values here as in your online banking portal
add.account.dialog.customer.id=Customer Id (Account number)
add.account.dialog.customer.id.hint=The user name you use for logging in into online banking

View File

@ -35,7 +35,7 @@ account.transactions.table.context.menu.show.transaction.details=Details anzeige
add.account.dialog.title=Konto hinzufügen
add.account.dialog.bank.code.label=Bankleitzahl
add.account.dialog.bank.label=Bank (Suche auch mittels Bankleitzahl oder Ort)
add.account.dialog.customer.id.and.password.hint=Geben Sie hier die selben Werte ein wie auf Ihrer Online Banking Webseite
add.account.dialog.customer.id=Kundennummer (Kontonummer)
add.account.dialog.customer.id.hint=Der Nutzernamen den Sie fürs Online Banking verwenden

View File

@ -43,7 +43,7 @@ open class AddAccountDialog(protected val presenter: BankingPresenter) : Window(
protected val dialogService = JavaFxDialogService()
protected val bankCode = SimpleStringProperty("")
protected val bankName = SimpleStringProperty("")
protected var txtfldBankCode: AutoCompletionSearchTextField<BankInfo> by singleAssign()
@ -67,7 +67,7 @@ open class AddAccountDialog(protected val presenter: BankingPresenter) : Window(
init {
bankCode.addListener { _, _, newValue -> searchBanks(newValue) }
bankName.addListener { _, _, newValue -> searchBanks(newValue) }
customerId.addListener { _, _, _ -> checkIfRequiredDataHasBeenEntered() }
@ -78,13 +78,13 @@ open class AddAccountDialog(protected val presenter: BankingPresenter) : Window(
override val root = vbox {
prefWidth = 350.0
label(messages["add.account.dialog.bank.code.label"]) {
label(messages["add.account.dialog.bank.label"]) {
vboxConstraints {
margin = LabelMargins
}
}
txtfldBankCode = autocompletionsearchtextfield(bankCode) {
txtfldBankCode = autocompletionsearchtextfield(bankName) {
prefHeight = TextFieldHeight
onAutoCompletion = { bankSelected(it) }
@ -213,7 +213,7 @@ open class AddAccountDialog(protected val presenter: BankingPresenter) : Window(
selectedBank = bank
bankCode.value = bank.bankCode
bankName.value = bank.name
checkIfRequiredDataHasBeenEntered()