Fix list item spacing
This commit is contained in:
parent
020c0b244c
commit
f17336b615
@ -53,13 +53,10 @@ fun FileItem(
|
|||||||
Row(
|
Row(
|
||||||
verticalAlignment = Alignment.Top
|
verticalAlignment = Alignment.Top
|
||||||
) {
|
) {
|
||||||
val textPadding by transition.animateDp(label = "textPadding") {
|
|
||||||
if (it) 16.dp else 12.dp
|
|
||||||
}
|
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.padding(start = 16.dp, top = textPadding, end = 16.dp)
|
.padding(16.dp)
|
||||||
) {
|
) {
|
||||||
val textStyle by animateTextStyleAsState(
|
val textStyle by animateTextStyleAsState(
|
||||||
if (showDetails) MaterialTheme.typography.titleMedium
|
if (showDetails) MaterialTheme.typography.titleMedium
|
||||||
@ -76,7 +73,8 @@ fun FileItem(
|
|||||||
file.getFileType(context),
|
file.getFileType(context),
|
||||||
style = MaterialTheme.typography.bodySmall,
|
style = MaterialTheme.typography.bodySmall,
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
overflow = TextOverflow.Ellipsis
|
overflow = TextOverflow.Ellipsis,
|
||||||
|
modifier = Modifier.padding(top = 2.dp)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
AnimatedVisibility(showDetails) {
|
AnimatedVisibility(showDetails) {
|
||||||
|
|||||||
@ -54,18 +54,15 @@ fun AppShortcutItem(
|
|||||||
modifier = modifier
|
modifier = modifier
|
||||||
) {
|
) {
|
||||||
Row {
|
Row {
|
||||||
val topPadding by transition.animateDp(label = "topPadding") {
|
|
||||||
if (it) 16.dp else 14.dp
|
|
||||||
}
|
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.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)
|
val titleStyle by animateTextStyleAsState(if (showDetails) MaterialTheme.typography.titleMedium else MaterialTheme.typography.titleSmall)
|
||||||
Text(text = shortcut.label, style = titleStyle, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
Text(text = shortcut.label, style = titleStyle, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||||
val textSpace by transition.animateDp(label = "textSpace") {
|
val textSpace by transition.animateDp(label = "textSpace") {
|
||||||
if (it) 4.dp else 0.dp
|
if (it) 4.dp else 2.dp
|
||||||
}
|
}
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.shortcut_summary, shortcut.appName),
|
text = stringResource(R.string.shortcut_summary, shortcut.appName),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user