Dense date labels: rule + label above column, row alignment Bottom
Date label cells show 'Jul 28 ────' above the thumbnail. Cells without a label have no spacer — they sit tightly against the row above. Row uses Alignment.Bottom so all thumbnails in a row align at the bottom edge even when some cells have a label header pushing them down.
This commit is contained in:
@@ -119,6 +119,7 @@ fun DensePhotoGrid(
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp),
|
||||
horizontalArrangement = Arrangement.spacedBy(2.dp),
|
||||
verticalAlignment = Alignment.Bottom,
|
||||
) {
|
||||
row.photos.forEach { labeled ->
|
||||
DenseThumb(
|
||||
@@ -171,18 +172,29 @@ private fun DenseThumb(
|
||||
}
|
||||
|
||||
Column(modifier = modifier) {
|
||||
// Date label or invisible spacer — keeps all thumbnails in the row aligned
|
||||
if (dateLabel != null) {
|
||||
// Date label with trailing rule — sits above this specific column
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(4.dp),
|
||||
modifier = Modifier.fillMaxWidth().padding(top = 6.dp, bottom = 2.dp),
|
||||
) {
|
||||
Text(
|
||||
dateLabel,
|
||||
fontSize = 10.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.height(16.dp).padding(start = 1.dp),
|
||||
)
|
||||
} else {
|
||||
Spacer(Modifier.height(16.dp))
|
||||
HorizontalDivider(
|
||||
modifier = Modifier.weight(1f),
|
||||
thickness = 0.5.dp,
|
||||
color = MaterialTheme.colorScheme.outlineVariant,
|
||||
)
|
||||
}
|
||||
}
|
||||
// No spacer for cells without a label — rows collapse tightly.
|
||||
// Alignment within a row is handled by the Row using Alignment.Bottom
|
||||
// so thumbnails sit flush even when some cells have a label header.
|
||||
|
||||
Box(
|
||||
modifier = Modifier
|
||||
|
||||
Reference in New Issue
Block a user