mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 19:32:16 +00:00
Update: Make Block text selectable
This commit is contained in:
parent
3861582d66
commit
11b62e5101
@ -6,6 +6,7 @@ import androidx.compose.animation.core.tween
|
|||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.text.selection.SelectionContainer
|
||||||
import androidx.compose.material3.FilledTonalButton
|
import androidx.compose.material3.FilledTonalButton
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Surface
|
import androidx.compose.material3.Surface
|
||||||
@ -48,16 +49,18 @@ fun HtmlTextBlock(
|
|||||||
targetValue = if (isExpanded) Int.MAX_VALUE else 12,
|
targetValue = if (isExpanded) Int.MAX_VALUE else 12,
|
||||||
animationSpec = tween(durationMillis = 200)
|
animationSpec = tween(durationMillis = 200)
|
||||||
)
|
)
|
||||||
HtmlText(
|
SelectionContainer {
|
||||||
modifier = Modifier
|
HtmlText(
|
||||||
.fillMaxWidth()
|
modifier = Modifier
|
||||||
.padding(16.dp)
|
.fillMaxWidth()
|
||||||
.animateContentSize(),
|
.padding(16.dp)
|
||||||
text = description,
|
.animateContentSize(),
|
||||||
color = MaterialTheme.colorScheme.onBackground,
|
text = description,
|
||||||
maxLines = maxLines,
|
color = MaterialTheme.colorScheme.onBackground,
|
||||||
overflow = TextOverflow.Ellipsis
|
maxLines = maxLines,
|
||||||
)
|
overflow = TextOverflow.Ellipsis
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (description.length >= 290 && isExpandable) {
|
if (description.length >= 290 && isExpandable) {
|
||||||
FilledTonalButton(onClick = { isExpanded = !isExpanded }) {
|
FilledTonalButton(onClick = { isExpanded = !isExpanded }) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user