Fix list item spacing

This commit is contained in:
MM20 2022-03-21 15:25:12 +01:00
parent 020c0b244c
commit f17336b615
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389
2 changed files with 5 additions and 10 deletions

View File

@ -53,13 +53,10 @@ fun FileItem(
Row(
verticalAlignment = Alignment.Top
) {
val textPadding by transition.animateDp(label = "textPadding") {
if (it) 16.dp else 12.dp
}
Column(
modifier = Modifier
.weight(1f)
.padding(start = 16.dp, top = textPadding, end = 16.dp)
.padding(16.dp)
) {
val textStyle by animateTextStyleAsState(
if (showDetails) MaterialTheme.typography.titleMedium
@ -76,7 +73,8 @@ fun FileItem(
file.getFileType(context),
style = MaterialTheme.typography.bodySmall,
maxLines = 1,
overflow = TextOverflow.Ellipsis
overflow = TextOverflow.Ellipsis,
modifier = Modifier.padding(top = 2.dp)
)
}
AnimatedVisibility(showDetails) {

View File

@ -54,18 +54,15 @@ fun AppShortcutItem(
modifier = modifier
) {
Row {
val topPadding by transition.animateDp(label = "topPadding") {
if (it) 16.dp else 14.dp
}
Column(
modifier = Modifier
.weight(1f)
.padding(start = 16.dp, top = topPadding, bottom = 16.dp, end = 16.dp)
.padding(16.dp)
) {
val titleStyle by animateTextStyleAsState(if (showDetails) MaterialTheme.typography.titleMedium else MaterialTheme.typography.titleSmall)
Text(text = shortcut.label, style = titleStyle, maxLines = 1, overflow = TextOverflow.Ellipsis)
val textSpace by transition.animateDp(label = "textSpace") {
if (it) 4.dp else 0.dp
if (it) 4.dp else 2.dp
}
Text(
text = stringResource(R.string.shortcut_summary, shortcut.appName),