neiam
/apollos_crib
It's Apollo's Crib
public · Issues · Pulls 1 · Labels · Forks · Compare · Actions failure · Badges · Packages
⭐
Log in to mark this repository.
Set the values against the right edge
88dfaaf · Gabriel Morell · 2026-09-03 00:17
Message
{commit_body(@commit)}
Files changed
modified
clients/android/app/src/main/java/io/neiam/apolloscrib/targets/GtfsRenderer.kt
+5
−3
@@ -35,9 +35,11 @@ object GtfsRenderer : SourceRenderer {
| 35 | 35 | id = entry.key, |
| 36 | 36 | title = entry.label(), |
| 37 | 37 | subtitle = summary(soonest), |
| 38 | − // The stop's own glyph is whatever mostly calls there -- a bus | |
| 39 | − // stop and a subway platform should not look alike. | |
| 40 | − iconRes = modeIcon(soonest.firstOrNull()?.mode), | |
| 38 | + // The stop's own glyph is whatever calls there next -- a bus stop | |
| 39 | + // and a subway platform should not look alike. With nothing due | |
| 40 | + // there is nothing to read it off, and the generic mark is | |
| 41 | + // honest where a guess would not be. | |
| 42 | + iconRes = soonest.firstOrNull()?.let { modeIcon(it.mode) } ?: iconRes, | |
| 41 | 43 | rows = soonest.map { row(it) }, |
| 42 | 44 | empty = "Nothing due" |
| 43 | 45 | ) |
modified
clients/android/app/src/main/java/io/neiam/apolloscrib/ui/BoardScreen.kt
+15
−5
@@ -215,7 +215,10 @@ private fun PreviewCard(preview: Preview) {
| 215 | 215 | Row(Modifier.padding(16.dp)) { |
| 216 | 216 | Glyph(preview.iconRes, size = 28.dp, tint = palette.primary) |
| 217 | 217 | Spacer(Modifier.width(12.dp)) |
| 218 | − Column(verticalArrangement = Arrangement.spacedBy(2.dp)) { | |
| 218 | + Column( | |
| 219 | + modifier = Modifier.weight(1f), | |
| 220 | + verticalArrangement = Arrangement.spacedBy(2.dp) | |
| 221 | + ) { | |
| 219 | 222 | Text(preview.title, style = MaterialTheme.typography.titleMedium) |
| 220 | 223 | preview.subtitle?.let { |
| 221 | 224 | Text(it, style = MaterialTheme.typography.bodySmall, color = palette.dim) |
@@ -245,21 +248,28 @@ private fun PreviewCard(preview: Preview) {
| 245 | 248 | private fun BoardRow(row: io.neiam.apolloscrib.targets.Row) { |
| 246 | 249 | val palette = LocalAppTheme.current |
| 247 | 250 | Row( |
| 251 | + modifier = Modifier.fillMaxWidth(), | |
| 248 | 252 | verticalAlignment = Alignment.CenterVertically, |
| 249 | 253 | horizontalArrangement = Arrangement.spacedBy(6.dp) |
| 250 | 254 | ) { |
| 251 | 255 | Glyph(row.iconRes, size = 16.dp, tint = palette.dim) |
| 252 | 256 | if (row.text.isNotEmpty()) { |
| 253 | − // The stamps are the numbers; the text is what they are about. A | |
| 254 | − // long station name should lose its tail rather than push the | |
| 255 | − // counts off the card. | |
| 257 | + // Takes the space between, so the values end up against the right | |
| 258 | + // edge rather than trailing whatever length the label happened to | |
| 259 | + // be -- the times of one route line up under the times of the | |
| 260 | + // next. A long station name loses its tail rather than pushing | |
| 261 | + // the counts off the card. | |
| 256 | 262 | Text( |
| 257 | 263 | row.text, |
| 258 | 264 | style = MaterialTheme.typography.bodyMedium, |
| 259 | 265 | maxLines = 1, |
| 260 | 266 | overflow = TextOverflow.Ellipsis, |
| 261 | − modifier = Modifier.weight(1f, fill = false) | |
| 267 | + modifier = Modifier.weight(1f) | |
| 262 | 268 | ) |
| 269 | + } else { | |
| 270 | + // Nothing to label them with, but the values still belong in the | |
| 271 | + // same column as every other row's. | |
| 272 | + Spacer(Modifier.weight(1f)) | |
| 263 | 273 | } |
| 264 | 274 | row.stamps.forEach { stamp -> |
| 265 | 275 | Row( |
Parents: a971fe6