Extracted BankAccount.displayNameIncludingBankName

This commit is contained in:
dankl 2020-01-11 23:22:52 +01:00 committed by dankito
parent b4fc9d837f
commit c6f821d162
2 changed files with 5 additions and 2 deletions

View File

@ -21,7 +21,7 @@ open class BankAccount @JvmOverloads constructor(
val displayName: String val displayName: String
get() { get() {
var displayName = "${account.bank.name} ${identifier}" var displayName = identifier
subAccountNumber?.let { subAccountNumber?.let {
displayName += " ($it)" displayName += " ($it)"
} }
@ -29,6 +29,9 @@ open class BankAccount @JvmOverloads constructor(
return displayName return displayName
} }
val displayNameIncludingBankName: String
get() = "${account.bank.name} ${displayName}"
var bookedTransactions: List<AccountTransaction> = bookedAccountTransactions var bookedTransactions: List<AccountTransaction> = bookedAccountTransactions
protected set protected set

View File

@ -20,7 +20,7 @@ open class BankAccountsAdapter(bankAccounts: List<BankAccount>) : ListAdapter<Ba
val view = convertView ?: inflater?.inflate(R.layout.list_item_bank_account, parent, false) val view = convertView ?: inflater?.inflate(R.layout.list_item_bank_account, parent, false)
view?.let { view?.let {
view.txtBankAccountDisplayName.text = item.displayName view.txtBankAccountDisplayName.text = item.displayNameIncludingBankName
} }
return view return view