No need to pass maxLines = 1 if singleline = true anymore.

This commit is contained in:
Benoit Marty 2023-06-09 18:16:23 +02:00
parent 9527c6825e
commit 4f4d024a9f
5 changed files with 3 additions and 6 deletions

View file

@ -208,7 +208,6 @@ internal fun LoginForm(
focusManager.moveFocus(FocusDirection.Down)
}),
singleLine = true,
maxLines = 1,
trailingIcon = if (loginFieldState.isNotEmpty()) {
{
IconButton(onClick = {
@ -263,7 +262,6 @@ internal fun LoginForm(
onDone = { onSubmit() }
),
singleLine = true,
maxLines = 1,
)
}
}

View file

@ -127,7 +127,6 @@ fun SearchAccountProviderView(
imeAction = ImeAction.Done,
),
singleLine = true,
maxLines = 1,
trailingIcon = if (userInputState.isNotEmpty()) {
{
IconButton(onClick = {

View file

@ -36,8 +36,8 @@ fun LabelledTextField(
value: String,
modifier: Modifier = Modifier,
placeholder: String? = null,
maxLines: Int = Int.MAX_VALUE,
singleLine: Boolean = false,
maxLines: Int = if (singleLine) 1 else Int.MAX_VALUE,
onValueChange: (String) -> Unit = {},
) {
Column(

View file

@ -66,7 +66,7 @@ fun OutlinedTextField(
keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
keyboardActions: KeyboardActions = KeyboardActions.Default,
singleLine: Boolean = false,
maxLines: Int = Int.MAX_VALUE,
maxLines: Int = if (singleLine) 1 else Int.MAX_VALUE,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
shape: Shape = OutlinedTextFieldDefaults.shape,
colors: TextFieldColors = OutlinedTextFieldDefaults.colors()

View file

@ -67,7 +67,7 @@ fun TextField(
keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
keyboardActions: KeyboardActions = KeyboardActions.Default,
singleLine: Boolean = false,
maxLines: Int = Int.MAX_VALUE,
maxLines: Int = if (singleLine) 1 else Int.MAX_VALUE,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
shape: Shape = TextFieldDefaults.shape,
colors: TextFieldColors = TextFieldDefaults.colors()