mirror of
https://github.com/revanced/revanced-manager-compose-old.git
synced 2025-04-29 22:14:28 +02:00
feat: improve patch card
This commit is contained in:
parent
74318f30fb
commit
45829d00bb
@ -34,30 +34,21 @@ fun PatchCard(patchClass: PatchClass, isSelected: Boolean, onSelected: () -> Uni
|
||||
enabled = !patchClass.unsupported,
|
||||
onClick = onSelected
|
||||
) {
|
||||
Column(modifier = Modifier.padding(12.dp, 0.dp, 12.dp, 12.dp)) {
|
||||
Row {
|
||||
Column(
|
||||
Modifier
|
||||
.align(Alignment.CenterVertically)
|
||||
Column(modifier = Modifier.padding(16.dp, 12.dp, 16.dp, 16.dp)) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Text(
|
||||
text = name.replace("-", " ").split(" ")
|
||||
.joinToString(" ") { it.replaceFirstChar(Char::uppercase) },
|
||||
style = MaterialTheme.typography.titleMedium
|
||||
)
|
||||
}
|
||||
Spacer(Modifier.width(4.dp))
|
||||
Row(
|
||||
Modifier
|
||||
.align(Alignment.CenterVertically)
|
||||
) {
|
||||
Text(
|
||||
text = patch.version ?: "unknown",
|
||||
style = Typography.bodySmall
|
||||
)
|
||||
}
|
||||
Spacer(Modifier.weight(1f, true))
|
||||
Column(modifier = Modifier.padding(0.dp, 6.dp)) {
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
@ -83,16 +74,16 @@ fun PatchCard(patchClass: PatchClass, isSelected: Boolean, onSelected: () -> Uni
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var isExpanded by remember { mutableStateOf(false) }
|
||||
patch.description?.let { desc ->
|
||||
Text(
|
||||
text = desc,
|
||||
modifier = Modifier
|
||||
.padding(0.dp, 8.dp, 22.dp, 8.dp)
|
||||
.padding(0.dp, 4.dp, 30.dp, 4.dp)
|
||||
.clickable { isExpanded = !isExpanded },
|
||||
maxLines = if (isExpanded) Int.MAX_VALUE else 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
softWrap = true,
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user