Update: Refine products' list item

This commit is contained in:
machiav3lli 2022-02-27 01:00:04 +01:00
parent d98cd66a6f
commit 5a00861e00

View File

@ -60,27 +60,33 @@ fun ProductsListItem(
Column( Column(
modifier = Modifier.requiredHeight(64.dp) modifier = Modifier.requiredHeight(64.dp)
) { ) {
Box( Row(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.fillMaxHeight(0.4f), .fillMaxHeight(0.4f),
) { ) {
Text( Text(
text = item.name, text = item.name,
modifier = Modifier.align(Alignment.CenterStart), modifier = Modifier
.align(Alignment.CenterVertically)
.weight(1f),
softWrap = true, softWrap = true,
overflow = TextOverflow.Ellipsis, overflow = TextOverflow.Ellipsis,
maxLines = 1,
style = MaterialTheme.typography.titleMedium style = MaterialTheme.typography.titleMedium
) )
Text( Text(
text = item.version, text = item.version,
modifier = Modifier.align(Alignment.CenterEnd), modifier = Modifier.align(Alignment.CenterVertically),
overflow = TextOverflow.Ellipsis, overflow = TextOverflow.Ellipsis,
style = MaterialTheme.typography.bodySmall maxLines = 1,
style = MaterialTheme.typography.bodySmall,
) )
} }
Text( Text(
modifier = Modifier.fillMaxHeight(), modifier = Modifier
.fillMaxHeight()
.fillMaxWidth(),
text = item.summary, text = item.summary,
style = MaterialTheme.typography.bodySmall, style = MaterialTheme.typography.bodySmall,
overflow = TextOverflow.Ellipsis, overflow = TextOverflow.Ellipsis,
@ -122,7 +128,7 @@ fun ExpandedItemContent(
) { ) {
Icon( Icon(
painter = painterResource(id = R.drawable.ic_download), painter = painterResource(id = R.drawable.ic_download),
contentDescription = "Add to Favourite" contentDescription = "Install"
) )
Text(text = "Install") Text(text = "Install")
} }