mirror of
https://github.com/BetterAndroid/FlexiUI.git
synced 2025-09-09 03:54:23 +08:00
refactor: make softWrap follow singleLine and change overflow default to TextOverflow.Ellipsis in Text
This commit is contained in:
@@ -44,11 +44,11 @@ fun Text(
|
|||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
color: Color = Color.Unspecified,
|
color: Color = Color.Unspecified,
|
||||||
style: TextStyle = Text.style,
|
style: TextStyle = Text.style,
|
||||||
overflow: TextOverflow = TextOverflow.Clip,
|
|
||||||
softWrap: Boolean = true,
|
|
||||||
singleLine: Boolean = false,
|
singleLine: Boolean = false,
|
||||||
maxLines: Int = if (singleLine) 1 else Int.MAX_VALUE,
|
maxLines: Int = if (singleLine) 1 else Int.MAX_VALUE,
|
||||||
minLines: Int = 1,
|
minLines: Int = 1,
|
||||||
|
overflow: TextOverflow = TextOverflow.Ellipsis,
|
||||||
|
softWrap: Boolean = !singleLine || maxLines > 1,
|
||||||
onTextLayout: (TextLayoutResult) -> Unit = {}
|
onTextLayout: (TextLayoutResult) -> Unit = {}
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
@@ -71,11 +71,11 @@ fun Text(
|
|||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
color: Color = Color.Unspecified,
|
color: Color = Color.Unspecified,
|
||||||
style: TextStyle = Text.style,
|
style: TextStyle = Text.style,
|
||||||
overflow: TextOverflow = TextOverflow.Clip,
|
|
||||||
softWrap: Boolean = true,
|
|
||||||
singleLine: Boolean = false,
|
singleLine: Boolean = false,
|
||||||
maxLines: Int = if (singleLine) 1 else Int.MAX_VALUE,
|
maxLines: Int = if (singleLine) 1 else Int.MAX_VALUE,
|
||||||
minLines: Int = 1,
|
minLines: Int = 1,
|
||||||
|
overflow: TextOverflow = TextOverflow.Ellipsis,
|
||||||
|
softWrap: Boolean = !singleLine || maxLines > 1,
|
||||||
inlineContent: Map<String, InlineTextContent> = mapOf(),
|
inlineContent: Map<String, InlineTextContent> = mapOf(),
|
||||||
onTextLayout: (TextLayoutResult) -> Unit = {}
|
onTextLayout: (TextLayoutResult) -> Unit = {}
|
||||||
) {
|
) {
|
||||||
|
Reference in New Issue
Block a user