diff --git a/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/Account.kt b/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/Account.kt index 48449745..47cf3d4a 100644 --- a/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/Account.kt +++ b/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/Account.kt @@ -24,6 +24,9 @@ open class Account( var tanMedia: List = listOf() + val displayName: String + get() = bank.name + val balance: BigDecimal get() = bankAccounts.map { it.balance }.fold(BigDecimal.ZERO) { acc, e -> acc + e } diff --git a/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/Bank.kt b/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/Bank.kt index 16fd9d07..2be70a5f 100644 --- a/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/Bank.kt +++ b/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/Bank.kt @@ -12,6 +12,9 @@ open class Bank( internal constructor() : this("", "", "", "") // for object deserializers + val displayName: String + get() = name + var iconUrl: String? = null diff --git a/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/BankAccount.kt b/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/BankAccount.kt index 1d21985d..3b076c36 100644 --- a/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/BankAccount.kt +++ b/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/BankAccount.kt @@ -19,6 +19,16 @@ open class BankAccount @JvmOverloads constructor( internal constructor() : this(Account(), "", "", null, null) // for object deserializers + val displayName: String + get() { + var displayName = "${account.bank.name} ${identifier}" + subAccountNumber?.let { + displayName += " ($it)" + } + + return displayName + } + var bookedTransactions: List = bookedAccountTransactions protected set diff --git a/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/adapter/BankAccountsAdapter.kt b/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/adapter/BankAccountsAdapter.kt index cce7abc2..9723cf20 100644 --- a/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/adapter/BankAccountsAdapter.kt +++ b/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/adapter/BankAccountsAdapter.kt @@ -20,12 +20,7 @@ open class BankAccountsAdapter(bankAccounts: List) : ListAdapter