Wasn't aware of ExposedDropdownMenuDefaults.TrailingIcon, using now that one instead of implementing the functionality by myself
This commit is contained in:
parent
d22ff34a37
commit
5a49e48ea8
|
@ -88,7 +88,7 @@ fun EnterTanDialog(tanChallengeReceived: TanChallengeReceived, onDismiss: () ->
|
|||
|
||||
Row(Modifier.padding(top = 16.dp)) {
|
||||
Select(
|
||||
"TAN Verfahren", "Alle TAN Medien anzeigen",
|
||||
"TAN Verfahren",
|
||||
challenge.availableTanMethods.sortedBy { it.identifier },
|
||||
challenge.selectedTanMethod,
|
||||
{ Log.info { "User selected TanMethod $it" } }, // TODO: change TanMethod
|
||||
|
@ -99,7 +99,7 @@ fun EnterTanDialog(tanChallengeReceived: TanChallengeReceived, onDismiss: () ->
|
|||
if (challenge.availableTanMedia.isNotEmpty()) {
|
||||
Row(Modifier.padding(top = 16.dp)) {
|
||||
Select(
|
||||
"TAN Medium", "Alle TAN Medien anzeigen",
|
||||
"TAN Medium",
|
||||
challenge.availableTanMedia.sortedBy { it.status }.map { it.displayName },
|
||||
challenge.selectedTanMedium?.displayName ?: "<Keines ausgewählt>",
|
||||
{ Log.info { "User selected TanMedium $it" } }, // TODO: change TanMethod
|
||||
|
|
|
@ -118,7 +118,7 @@ fun TransferMoneyDialog(
|
|||
) {
|
||||
if (accountsSupportingTransferringMoney.size > 1) {
|
||||
Select(
|
||||
"Konto", "Alle Konten anzeigen",
|
||||
"Konto",
|
||||
accountsSupportingTransferringMoney, senderAccount, { senderAccount = it },
|
||||
{ account -> "${accountsToUserAccount[account]?.displayName} ${account.displayName}" },
|
||||
{ BankIcon(accountsToUserAccount[senderAccount]) }
|
||||
|
|
|
@ -2,9 +2,6 @@ package net.codinux.banking.ui.forms
|
|||
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.material.*
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.ArrowDropDown
|
||||
import androidx.compose.material.icons.filled.ArrowDropUp
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Modifier
|
||||
|
||||
|
@ -12,7 +9,6 @@ import androidx.compose.ui.Modifier
|
|||
@Composable
|
||||
fun <T> Select(
|
||||
label: String,
|
||||
contentDescription: String,
|
||||
items: Collection<T>,
|
||||
selectedItem: T,
|
||||
onSelectedItemChanged: (T) -> Unit,
|
||||
|
@ -30,13 +26,7 @@ fun <T> Select(
|
|||
label = { Text(label) },
|
||||
readOnly = true,
|
||||
maxLines = 1,
|
||||
trailingIcon = {
|
||||
if (showDropDownMenu) {
|
||||
Icon(Icons.Filled.ArrowDropUp, contentDescription)
|
||||
} else {
|
||||
Icon(Icons.Filled.ArrowDropDown, contentDescription)
|
||||
}
|
||||
},
|
||||
trailingIcon = { ExposedDropdownMenuDefaults.TrailingIcon(showDropDownMenu) },
|
||||
leadingIcon = leadingIcon
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue