Showing account selection composable if more than one account is available

This commit is contained in:
dankito 2024-09-05 00:00:39 +02:00
parent 612341cf45
commit 91c75a388d
1 changed files with 11 additions and 9 deletions

View File

@ -116,16 +116,18 @@ fun TransferMoneyDialog(
onDismiss = onDismiss,
onConfirm = { confirmCalled() }
) {
Select(
"Konto", "Alle Konten anzeigen",
accountsSupportingTransferringMoney, senderAccount, { senderAccount = it },
{ account -> "${accountsToUserAccount[account]?.displayName} ${account.displayName}" },
{ BankIcon(accountsToUserAccount[senderAccount]) }
) { account ->
Row(Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) {
BankIcon(accountsToUserAccount[account], Modifier.padding(end = 6.dp))
if (accountsSupportingTransferringMoney.size > 1) {
Select(
"Konto", "Alle Konten anzeigen",
accountsSupportingTransferringMoney, senderAccount, { senderAccount = it },
{ account -> "${accountsToUserAccount[account]?.displayName} ${account.displayName}" },
{ BankIcon(accountsToUserAccount[senderAccount]) }
) { account ->
Row(Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) {
BankIcon(accountsToUserAccount[account], Modifier.padding(end = 6.dp))
Text("${accountsToUserAccount[account]?.displayName} ${account.displayName}")
Text("${accountsToUserAccount[account]?.displayName} ${account.displayName}")
}
}
}