brandonmcansh
01/30/2024, 5:21 PMHalil Ozercan
01/30/2024, 5:24 PMbrandonmcansh
01/30/2024, 5:25 PMbrandonmcansh
01/30/2024, 5:27 PMval backgroundColor by colors.backgroundColor(enabled = enabled)
val textColor by colors.textColor(enabled = enabled)
val placeholderColor by colors.placeholderColor(enabled = enabled)
BasicTextField2(
modifier = modifier
.background(backgroundColor, shape),
enabled = enabled,
readOnly = readOnly,
state = state,
cursorBrush = SolidColor(colors.cursorColor(isError = false).value),
keyboardOptions = keyboardOptions,
keyboardActions = keyboardActions,
textStyle = style.copy(color = textColor),
lineLimits = TextFieldLineLimits.SingleLine,
decorator = {
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.CenterStart) {
Row(
modifier = Modifier.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(CodeTheme.dimens.staticGrid.x2)
) {
leadingIcon?.invoke()
Box(
modifier = Modifier
.weight(1f)
.padding(horizontal = CodeTheme.dimens.staticGrid.x2)
.height(IntrinsicSize.Max),
contentAlignment = Alignment.CenterStart
) {
it()
if (state.text.isEmpty() && placeholder.isNotEmpty()) {
Text(
modifier = Modifier
.matchParentSize(),
text = placeholder,
style = CodeTheme.typography.subtitle1,
maxLines = 1,
color = placeholderColor,
)
}
}
trailingIcon?.invoke()
}
}
},
scrollState = scrollState
)
Halil Ozercan
01/30/2024, 5:27 PMbrandonmcansh
01/30/2024, 5:27 PMTextInput(
modifier = Modifier
.fillMaxWidth()
.height(CodeTheme.dimens.grid.x12)
.border(1.dp, Color.White, CodeTheme.shapes.extraSmall),
maxLines = 1,
state = rememberTextFieldState()
)
brandonmcansh
01/30/2024, 5:30 PMThis also doesn't look like a decorator issue. Text and cursor are drawn inside the inner text field.Yeah thats what I was figuring as well
brandonmcansh
01/30/2024, 5:36 PMBasicTextField2(
modifier = Modifier
.background(backgroundColor, shape).then(modifier),
enabled = enabled,
readOnly = readOnly,
state = state,
cursorBrush = SolidColor(colors.cursorColor(isError = false).value),
keyboardOptions = keyboardOptions,
keyboardActions = keyboardActions,
textStyle = style.copy(color = textColor),
lineLimits = TextFieldLineLimits.SingleLine,
scrollState = scrollState
)
TextInput(
modifier = Modifier
.fillMaxWidth()
.padding(10.dp),
shape = CodeTheme.shapes.extraSmall,
maxLines = 1,
state = rememberTextFieldState()
)
brandonmcansh
01/30/2024, 5:41 PMHalil Ozercan
01/30/2024, 6:05 PMbrandonmcansh
01/30/2024, 6:09 PMbrandonmcansh
01/30/2024, 6:10 PMbrandonmcansh
01/30/2024, 6:12 PMbrandonmcansh
01/30/2024, 6:12 PMbrandonmcansh
01/30/2024, 6:12 PMbrandonmcansh
01/30/2024, 6:13 PMZach Klippenstein (he/him) [MOD]
01/30/2024, 6:22 PMbrandonmcansh
01/30/2024, 6:22 PMZach Klippenstein (he/him) [MOD]
01/30/2024, 6:22 PMbrandonmcansh
01/30/2024, 6:22 PMbrandonmcansh
01/30/2024, 6:22 PMbrandonmcansh
01/30/2024, 6:31 PMbrandonmcansh
01/30/2024, 6:31 PMZach Klippenstein (he/him) [MOD]
01/30/2024, 6:32 PMbrandonmcansh
01/30/2024, 6:32 PMZach Klippenstein (he/him) [MOD]
01/30/2024, 6:45 PMbrandonmcansh
01/30/2024, 6:49 PMbrandonmcansh
01/30/2024, 6:51 PM