Skip to content

Commit 47a1144

Browse files
committed
fix(#9): support minLines
1 parent 25f0ea0 commit 47a1144

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed

common/src/commonMain/kotlin/BaseHtmlText.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import androidx.compose.ui.platform.LocalDensity
1212
import androidx.compose.ui.platform.LocalUriHandler
1313
import androidx.compose.ui.semantics.contentDescription
1414
import androidx.compose.ui.semantics.hideFromAccessibility
15-
import androidx.compose.ui.semantics.onClick
1615
import androidx.compose.ui.semantics.semantics
1716
import androidx.compose.ui.text.AnnotatedString
1817
import androidx.compose.ui.text.TextLayoutResult

material-html-text/src/androidMain/kotlin/HtmlText.android.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ fun HtmlText(
6868
overflow: TextOverflow = TextOverflow.Clip,
6969
softWrap: Boolean = true,
7070
maxLines: Int = Int.MAX_VALUE,
71+
minLines: Int = 1,
7172
inlineContent: Map<String, InlineTextContent> = mapOf(),
7273
onTextLayout: (TextLayoutResult) -> Unit = {},
7374
style: TextStyle = LocalTextStyle.current,
@@ -100,6 +101,7 @@ fun HtmlText(
100101
overflow = overflow,
101102
softWrap = softWrap,
102103
maxLines = maxLines,
104+
minLines = minLines,
103105
inlineContent = inlineContent,
104106
onTextLayout = onTextLayout,
105107
style = style,

material-html-text/src/commonMain/kotlin/HtmlText.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ fun HtmlText(
5252
overflow: TextOverflow = TextOverflow.Clip,
5353
softWrap: Boolean = true,
5454
maxLines: Int = Int.MAX_VALUE,
55+
minLines: Int = 1,
5556
inlineContent: Map<String, InlineTextContent> = mapOf(),
5657
onTextLayout: (TextLayoutResult) -> Unit = {},
5758
style: TextStyle = LocalTextStyle.current,
@@ -85,6 +86,7 @@ fun HtmlText(
8586
overflow = overflow,
8687
softWrap = softWrap,
8788
maxLines = maxLines,
89+
minLines = minLines,
8890
inlineContent = inlineContent,
8991
onTextLayout = onTextLayout,
9092
style = style,
@@ -119,6 +121,7 @@ fun HtmlText(
119121
overflow: TextOverflow = TextOverflow.Clip,
120122
softWrap: Boolean = true,
121123
maxLines: Int = Int.MAX_VALUE,
124+
minLines: Int = 1,
122125
inlineContent: Map<String, InlineTextContent> = mapOf(),
123126
onTextLayout: (TextLayoutResult) -> Unit = {},
124127
style: TextStyle = LocalTextStyle.current,
@@ -152,6 +155,7 @@ fun HtmlText(
152155
overflow = overflow,
153156
softWrap = softWrap,
154157
maxLines = maxLines,
158+
minLines = minLines,
155159
inlineContent = inlineContent,
156160
onTextLayout = onTextLayout,
157161
style = style,
@@ -193,6 +197,7 @@ fun HtmlText(
193197
overflow: TextOverflow = TextOverflow.Clip,
194198
softWrap: Boolean = true,
195199
maxLines: Int = Int.MAX_VALUE,
200+
minLines: Int = 1,
196201
inlineContent: Map<String, InlineTextContent> = mapOf(),
197202
onTextLayout: (TextLayoutResult) -> Unit = {},
198203
style: TextStyle = LocalTextStyle.current,
@@ -220,6 +225,7 @@ fun HtmlText(
220225
overflow = overflow,
221226
softWrap = softWrap,
222227
maxLines = maxLines,
228+
minLines = minLines,
223229
inlineContent = inlineContent,
224230
onTextLayout = onTextLayout,
225231
style = style

material3-html-text/src/androidMain/kotlin/HtmlText.android.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ fun HtmlText(
6666
overflow: TextOverflow = TextOverflow.Clip,
6767
softWrap: Boolean = true,
6868
maxLines: Int = Int.MAX_VALUE,
69+
minLines: Int = 1,
6970
inlineContent: Map<String, InlineTextContent> = mapOf(),
7071
onTextLayout: (TextLayoutResult) -> Unit = {},
7172
style: TextStyle = LocalTextStyle.current,
@@ -98,6 +99,7 @@ fun HtmlText(
9899
overflow = overflow,
99100
softWrap = softWrap,
100101
maxLines = maxLines,
102+
minLines = minLines,
101103
inlineContent = inlineContent,
102104
onTextLayout = onTextLayout,
103105
style = style,

material3-html-text/src/commonMain/kotlin/HtmlText.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ fun HtmlText(
5252
overflow: TextOverflow = TextOverflow.Clip,
5353
softWrap: Boolean = true,
5454
maxLines: Int = Int.MAX_VALUE,
55+
minLines: Int = 1,
5556
inlineContent: Map<String, InlineTextContent> = mapOf(),
5657
onTextLayout: (TextLayoutResult) -> Unit = {},
5758
style: TextStyle = LocalTextStyle.current,
@@ -84,6 +85,7 @@ fun HtmlText(
8485
overflow = overflow,
8586
softWrap = softWrap,
8687
maxLines = maxLines,
88+
minLines = minLines,
8789
inlineContent = inlineContent,
8890
onTextLayout = onTextLayout,
8991
style = style,
@@ -118,6 +120,7 @@ fun HtmlText(
118120
overflow: TextOverflow = TextOverflow.Clip,
119121
softWrap: Boolean = true,
120122
maxLines: Int = Int.MAX_VALUE,
123+
minLines: Int = 1,
121124
inlineContent: Map<String, InlineTextContent> = mapOf(),
122125
onTextLayout: (TextLayoutResult) -> Unit = {},
123126
style: TextStyle = LocalTextStyle.current,
@@ -150,6 +153,7 @@ fun HtmlText(
150153
overflow = overflow,
151154
softWrap = softWrap,
152155
maxLines = maxLines,
156+
minLines = minLines,
153157
inlineContent = inlineContent,
154158
onTextLayout = onTextLayout,
155159
style = style,
@@ -191,6 +195,7 @@ fun HtmlText(
191195
overflow: TextOverflow = TextOverflow.Clip,
192196
softWrap: Boolean = true,
193197
maxLines: Int = Int.MAX_VALUE,
198+
minLines: Int = 1,
194199
inlineContent: Map<String, InlineTextContent> = mapOf(),
195200
onTextLayout: (TextLayoutResult) -> Unit = {},
196201
style: TextStyle = LocalTextStyle.current,
@@ -218,6 +223,7 @@ fun HtmlText(
218223
overflow = overflow,
219224
softWrap = softWrap,
220225
maxLines = maxLines,
226+
minLines = minLines,
221227
inlineContent = inlineContent,
222228
onTextLayout = onTextLayout,
223229
style = style

0 commit comments

Comments
 (0)