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(
|
Row(
|
||||||
modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp),
|
modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp),
|
||||||
horizontalArrangement = Arrangement.spacedBy(2.dp),
|
horizontalArrangement = Arrangement.spacedBy(2.dp),
|
||||||
|
verticalAlignment = Alignment.Bottom,
|
||||||
) {
|
) {
|
||||||
row.photos.forEach { labeled ->
|
row.photos.forEach { labeled ->
|
||||||
DenseThumb(
|
DenseThumb(
|
||||||
@@ -171,18 +172,29 @@ private fun DenseThumb(
|
|||||||
}
|
}
|
||||||
|
|
||||||
Column(modifier = modifier) {
|
Column(modifier = modifier) {
|
||||||
// Date label or invisible spacer — keeps all thumbnails in the row aligned
|
|
||||||
if (dateLabel != null) {
|
if (dateLabel != null) {
|
||||||
Text(
|
// Date label with trailing rule — sits above this specific column
|
||||||
dateLabel,
|
Row(
|
||||||
fontSize = 10.sp,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
fontWeight = FontWeight.Medium,
|
horizontalArrangement = Arrangement.spacedBy(4.dp),
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
modifier = Modifier.fillMaxWidth().padding(top = 6.dp, bottom = 2.dp),
|
||||||
modifier = Modifier.height(16.dp).padding(start = 1.dp),
|
) {
|
||||||
)
|
Text(
|
||||||
} else {
|
dateLabel,
|
||||||
Spacer(Modifier.height(16.dp))
|
fontSize = 10.sp,
|
||||||
|
fontWeight = FontWeight.Medium,
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
|
)
|
||||||
|
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(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
|||||||
Reference in New Issue
Block a user