From 8005b44309e9b95c78d6db3753f27658aaa5628a Mon Sep 17 00:00:00 2001 From: dankito Date: Thu, 5 Sep 2024 00:15:47 +0200 Subject: [PATCH] Renamed AutocompleteTextFieldNew to AutocompleteTextField --- .../net/codinux/banking/ui/dialogs/AddAccountDialog.kt | 2 +- .../net/codinux/banking/ui/dialogs/TransferMoneyDialog.kt | 8 ++++---- ...tocompleteTextFieldNew.kt => AutocompleteTextField.kt} | 5 +---- 3 files changed, 6 insertions(+), 9 deletions(-) rename composeApp/src/commonMain/kotlin/net/codinux/banking/ui/forms/{AutocompleteTextFieldNew.kt => AutocompleteTextField.kt} (95%) diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/AddAccountDialog.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/AddAccountDialog.kt index bf0975d..59e9e86 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/AddAccountDialog.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/AddAccountDialog.kt @@ -70,7 +70,7 @@ fun AddAccountDialog( ) { Column { - AutocompleteTextFieldNew( + AutocompleteTextField( onSelectedItemChanged = { selectedBank = it }, label = "Bank (Suche mit Name, Bankleitzahl oder Ort)", getItemTitle = { bank -> bank.name }, diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/TransferMoneyDialog.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/TransferMoneyDialog.kt index f23dd84..ee9bf82 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/TransferMoneyDialog.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/TransferMoneyDialog.kt @@ -21,7 +21,7 @@ import net.codinux.banking.ui.IOorDefault import net.codinux.banking.ui.composables.BankIcon import net.codinux.banking.ui.config.Colors import net.codinux.banking.ui.config.DI -import net.codinux.banking.ui.forms.AutocompleteTextFieldNew +import net.codinux.banking.ui.forms.AutocompleteTextField import net.codinux.banking.ui.forms.OutlinedTextField import net.codinux.banking.ui.forms.Select import net.codinux.banking.ui.model.error.ErroneousAction @@ -132,7 +132,7 @@ fun TransferMoneyDialog( } Column(Modifier.padding(top = verticalSpace)) { - AutocompleteTextFieldNew( + AutocompleteTextField( "Name des Empfängers / der Empfängerin", dropdownMaxHeight = 350.dp, minTextLengthForSearch = 0, @@ -192,8 +192,8 @@ fun TransferMoneyDialog( Spacer(modifier = Modifier.height(verticalSpace)) - AutocompleteTextFieldNew( - "Verwendungszweck", + AutocompleteTextField( + "Verwendungszweck (optional)", dropdownMaxHeight = 250.dp, minTextLengthForSearch = 0, getItemTitle = { suggestion -> suggestion.reference }, diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/forms/AutocompleteTextFieldNew.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/forms/AutocompleteTextField.kt similarity index 95% rename from composeApp/src/commonMain/kotlin/net/codinux/banking/ui/forms/AutocompleteTextFieldNew.kt rename to composeApp/src/commonMain/kotlin/net/codinux/banking/ui/forms/AutocompleteTextField.kt index 4568722..e439d7d 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/forms/AutocompleteTextFieldNew.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/forms/AutocompleteTextField.kt @@ -1,7 +1,6 @@ package net.codinux.banking.ui.forms import androidx.compose.foundation.clickable -import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.* import androidx.compose.material.* import androidx.compose.material.icons.Icons @@ -9,18 +8,16 @@ import androidx.compose.material.icons.filled.Close import androidx.compose.runtime.* import androidx.compose.ui.Modifier import androidx.compose.ui.focus.* -import androidx.compose.ui.platform.LocalSoftwareKeyboardController import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import androidx.compose.ui.window.PopupProperties import kotlinx.coroutines.Job -import kotlinx.coroutines.delay import kotlinx.coroutines.launch import net.codinux.banking.ui.config.Colors @OptIn(ExperimentalMaterialApi::class) @Composable -fun AutocompleteTextFieldNew( +fun AutocompleteTextField( label: String, onSelectedItemChanged: (T?) -> Unit, onEnteredTextChanged: ((String) -> Unit)? = null,