Fix: Changelog block showing an expand button

This commit is contained in:
machiav3lli 2022-06-06 02:28:24 +02:00
parent 380792a36e
commit 0aa1ff9e22
2 changed files with 7 additions and 3 deletions

View File

@ -31,7 +31,8 @@ import de.charlex.compose.HtmlText
@Composable
fun HtmlTextBlock(
modifier: Modifier = Modifier,
description: String
description: String,
isExpandable: Boolean = true
) {
Column(
modifier = modifier.fillMaxWidth(),
@ -58,7 +59,7 @@ fun HtmlTextBlock(
overflow = TextOverflow.Ellipsis
)
}
if (description.length >= 290) {
if (description.length >= 290 && isExpandable) {
FilledTonalButton(onClick = { isExpanded = !isExpanded }) {
Text(text = stringResource(id = if (isExpanded) R.string.show_less else R.string.show_more))
}

View File

@ -655,7 +655,10 @@ class AppSheetX() : FullscreenBottomSheetDialogFragment(), Callbacks {
positive = true,
preExpanded = true
) {
HtmlTextBlock(description = product.whatsNew)
HtmlTextBlock(
description = product.whatsNew,
isExpandable = false
)
}
}
}