mirror of
https://github.com/BetterAndroid/FlexiUI.git
synced 2025-09-09 03:54:23 +08:00
refactor: adjust the priority of Modifier in TextField
This commit is contained in:
@@ -239,13 +239,14 @@ private fun TextFieldDecorationBox(
|
|||||||
else -> style.borderInactive
|
else -> style.borderInactive
|
||||||
}.copy(animatedBorderWidth, SolidColor(animatedBorderColor))
|
}.copy(animatedBorderWidth, SolidColor(animatedBorderColor))
|
||||||
Box(
|
Box(
|
||||||
Modifier.textField(
|
modifier = Modifier.textField(
|
||||||
colors = colors,
|
colors = colors,
|
||||||
style = style,
|
style = style,
|
||||||
border = border,
|
border = border,
|
||||||
enabled = enabled,
|
enabled = enabled,
|
||||||
interactionSource = interactionSource
|
interactionSource = interactionSource,
|
||||||
).then(modifier)
|
modifier = modifier
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
Row {
|
Row {
|
||||||
header()
|
header()
|
||||||
@@ -267,13 +268,15 @@ private fun Modifier.textField(
|
|||||||
style: TextFieldStyle,
|
style: TextFieldStyle,
|
||||||
border: BorderStroke,
|
border: BorderStroke,
|
||||||
enabled: Boolean,
|
enabled: Boolean,
|
||||||
interactionSource: MutableInteractionSource
|
interactionSource: MutableInteractionSource,
|
||||||
|
modifier: Modifier
|
||||||
) = status(enabled)
|
) = status(enabled)
|
||||||
.focusable(enabled, interactionSource)
|
.focusable(enabled, interactionSource)
|
||||||
.hoverable(interactionSource, enabled)
|
.hoverable(interactionSource, enabled)
|
||||||
.clip(style.shape)
|
.clip(style.shape)
|
||||||
.background(colors.backgroundColor, style.shape)
|
.background(colors.backgroundColor, style.shape)
|
||||||
.borderOrNot(border, style.shape)
|
.borderOrNot(border, style.shape)
|
||||||
|
.then(modifier)
|
||||||
.padding(
|
.padding(
|
||||||
top = style.topPadding.orElse() ?: style.padding,
|
top = style.topPadding.orElse() ?: style.padding,
|
||||||
start = style.startPadding.orElse() ?: style.padding,
|
start = style.startPadding.orElse() ?: style.padding,
|
||||||
|
Reference in New Issue
Block a user