From 0bf6bf7b5f209030fbc7ac09a1c2738dfa402ac3 Mon Sep 17 00:00:00 2001 From: darken Date: Sun, 30 Aug 2026 08:12:15 +0200 Subject: [PATCH 1/2] ui(overview): Center the case charges line in the battery card The line sat at a fixed 36.dp start indent, which put its left edge under the case percentage label (28.dp icon + 8.dp spacer). That follows the M3 "supporting text aligns with the item's text column" convention, but the case row is not a list item, and the sentence runs nearly full width, so the lone left gutter read as an accident rather than an alignment. Centering on the capsule instead would have been the other candidate, but the capsule is weight(1f) between the percentage label and the status-chip FlowRow, so its x-offset and width are both runtime values that vary with locale and font scale. No static padding reaches it; it would take onGloballyPositioned or a custom Layout, which is not worth it for a caption. Centering in the surface is stable and needs neither. --- .../darken/capod/main/ui/overview/cards/DualPodsCard.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/darken/capod/main/ui/overview/cards/DualPodsCard.kt b/app/src/main/java/eu/darken/capod/main/ui/overview/cards/DualPodsCard.kt index 0fc6d07a..1efebaae 100644 --- a/app/src/main/java/eu/darken/capod/main/ui/overview/cards/DualPodsCard.kt +++ b/app/src/main/java/eu/darken/capod/main/ui/overview/cards/DualPodsCard.kt @@ -46,6 +46,7 @@ import androidx.compose.ui.res.pluralStringResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.semantics.semantics import androidx.compose.ui.semantics.stateDescription +import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import eu.darken.capod.R @@ -493,8 +494,7 @@ private fun CaseRow( if (charges != null) { CaseChargesLine( charges = charges, - // Aligned under the percentage, past the case icon and its spacer. - modifier = Modifier.padding(start = 36.dp, top = 2.dp), + modifier = Modifier.padding(top = 2.dp), ) } } @@ -542,7 +542,10 @@ private fun CaseChargesLine( text = text, style = MaterialTheme.typography.bodySmall, color = color, - modifier = modifier.semantics { stateDescription = state }, + textAlign = TextAlign.Center, + modifier = modifier + .fillMaxWidth() + .semantics { stateDescription = state }, ) } From fbbdb4e131615f7c5fcf377352951b7ac06015b3 Mon Sep 17 00:00:00 2001 From: darken Date: Sun, 30 Aug 2026 08:12:23 +0200 Subject: [PATCH 2/2] ui(overview): Give the last known caption more room above At 4.dp the caption crowded the bottom edge of the battery surface it describes. 8.dp separates the two without pushing it far enough to read as its own block, which 12.dp (the gap used before the ANC selector) would. Both pod cards carry the caption, so both move together. --- .../java/eu/darken/capod/main/ui/overview/cards/DualPodsCard.kt | 2 +- .../eu/darken/capod/main/ui/overview/cards/SinglePodsCard.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/darken/capod/main/ui/overview/cards/DualPodsCard.kt b/app/src/main/java/eu/darken/capod/main/ui/overview/cards/DualPodsCard.kt index 1efebaae..00010dcd 100644 --- a/app/src/main/java/eu/darken/capod/main/ui/overview/cards/DualPodsCard.kt +++ b/app/src/main/java/eu/darken/capod/main/ui/overview/cards/DualPodsCard.kt @@ -288,7 +288,7 @@ private fun ColumnScope.DualPodsCardExpanded( // Cached battery indicator if (device.isBatteryCached && !device.isLive) { - Spacer(modifier = Modifier.height(4.dp)) + Spacer(modifier = Modifier.height(8.dp)) Text( text = stringResource(R.string.battery_cached_label, device.cachedBatteryFormatted(now)), style = MaterialTheme.typography.bodySmall, diff --git a/app/src/main/java/eu/darken/capod/main/ui/overview/cards/SinglePodsCard.kt b/app/src/main/java/eu/darken/capod/main/ui/overview/cards/SinglePodsCard.kt index 2d974503..e611085a 100644 --- a/app/src/main/java/eu/darken/capod/main/ui/overview/cards/SinglePodsCard.kt +++ b/app/src/main/java/eu/darken/capod/main/ui/overview/cards/SinglePodsCard.kt @@ -322,7 +322,7 @@ private fun ColumnScope.SinglePodsCardExpanded( // Cached battery indicator if (device.isBatteryCached && !device.isLive) { - Spacer(modifier = Modifier.height(4.dp)) + Spacer(modifier = Modifier.height(8.dp)) Text( text = stringResource(R.string.battery_cached_label, device.cachedBatteryFormatted(now)), style = MaterialTheme.typography.bodySmall,