From 8c07ad4669987bed666ff7dcb8a93bd2b4d182ab Mon Sep 17 00:00:00 2001 From: Mateusz Armatys Date: Thu, 6 Mar 2025 16:42:12 +0100 Subject: [PATCH] feat(presentation-compose): Additional options for `ProtonOutlinedTextFieldWithError` (minLines, trailingIcon). --- .../core/compose/component/ProtonOutlinedTextField.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/presentation-compose/src/main/kotlin/me/proton/core/compose/component/ProtonOutlinedTextField.kt b/presentation-compose/src/main/kotlin/me/proton/core/compose/component/ProtonOutlinedTextField.kt index 6dfef2e68..2d433e20d 100644 --- a/presentation-compose/src/main/kotlin/me/proton/core/compose/component/ProtonOutlinedTextField.kt +++ b/presentation-compose/src/main/kotlin/me/proton/core/compose/component/ProtonOutlinedTextField.kt @@ -51,6 +51,7 @@ import me.proton.core.compose.theme.captionNorm import me.proton.core.compose.theme.defaultNorm const val PROTON_OUTLINED_TEXT_INPUT_TAG = "PROTON_OUTLINED_TEXT_INPUT_TAG" +private const val MinLines = 1 private const val MaxLines = 2 @Composable @@ -127,11 +128,13 @@ fun ProtonOutlinedTextFieldWithError( keyboardOptions: KeyboardOptions = KeyboardOptions.Default, keyboardActions: KeyboardActions = KeyboardActions.Default, label: (@Composable () -> Unit)? = null, + minLines: Int = MinLines, maxLines: Int = MaxLines, placeholder: (@Composable () -> Unit)? = null, singleLine: Boolean = false, onValueChanged: (String) -> Unit, - visualTransformation: VisualTransformation = VisualTransformation.None + trailingIcon: @Composable (() -> Unit)? = null, + visualTransformation: VisualTransformation = VisualTransformation.None, ) { val focusRequester = remember { FocusRequester() } var textFieldLoaded by remember { mutableStateOf(false) } @@ -145,6 +148,7 @@ fun ProtonOutlinedTextFieldWithError( keyboardOptions = keyboardOptions, keyboardActions = keyboardActions, label = label, + minLines = minLines, maxLines = maxLines, modifier = Modifier .fillMaxWidth() @@ -162,6 +166,7 @@ fun ProtonOutlinedTextFieldWithError( placeholder = placeholder, singleLine = singleLine, textStyle = ProtonTheme.typography.defaultNorm, + trailingIcon = trailingIcon, visualTransformation = visualTransformation ) Text(