From 7ab23ce30e91b02df62a51f4a1f48a64c1b1f1a9 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 24 Apr 2026 12:55:28 +0000 Subject: [PATCH 1/2] fix: increase bottom bar icon size to compensate for MaterialSymbols padding MaterialSymbols glyphs have more internal padding than the previous MaterialIcons, so at 20dp they looked smaller than before. Bump the NavigationBar icons to 24dp (Material's default NavigationBar icon size) and widen the notification-dot box accordingly to preserve its offset. --- .../amethyst/ui/navigation/bottombars/AppBottomBar.kt | 8 ++++---- .../java/com/vitorpamplona/amethyst/ui/theme/Shape.kt | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/bottombars/AppBottomBar.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/bottombars/AppBottomBar.kt index e9f4985c4..561ff3bde 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/bottombars/AppBottomBar.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/bottombars/AppBottomBar.kt @@ -51,8 +51,8 @@ import com.vitorpamplona.amethyst.ui.stringRes import com.vitorpamplona.amethyst.ui.theme.DividerThickness import com.vitorpamplona.amethyst.ui.theme.Size0dp import com.vitorpamplona.amethyst.ui.theme.Size10Modifier -import com.vitorpamplona.amethyst.ui.theme.Size20dp -import com.vitorpamplona.amethyst.ui.theme.Size23dp +import com.vitorpamplona.amethyst.ui.theme.Size24dp +import com.vitorpamplona.amethyst.ui.theme.Size27dp @Composable fun AppBottomBar( @@ -141,8 +141,8 @@ private fun NotifiableIcon( destination: Route, accountViewModel: AccountViewModel, ) { - Box(Modifier.size(Size23dp)) { - val iconSizeModifier = Modifier.size(Size20dp) + Box(Modifier.size(Size27dp)) { + val iconSizeModifier = Modifier.size(Size24dp) val description = stringRes(def.labelRes) Icon( symbol = def.icon, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt index 940990b44..e1c01e032 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Shape.kt @@ -119,6 +119,7 @@ val Size22dp = 22.dp val Size23dp = 23.dp val Size24dp = 24.dp val Size25dp = 25.dp +val Size27dp = 27.dp val Size30dp = 30.dp val Size34dp = 34.dp val Size35dp = 35.dp From 15e63c48a281c4f0c7e52ba89e7cbed0e751b9b3 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 24 Apr 2026 13:04:30 +0000 Subject: [PATCH 2/2] fix(icons): render Material Symbols with the correct tint The painter measured the glyph with TextStyle(color = Unspecified) and tried to override the color at draw time via drawText(layout, color = tint). That override is unreliable across Compose versions: when the measured style carries Color.Unspecified, drawText can fall through to Color.Black, producing black-on-black icons (visible on the back arrow in dark mode). Include the tint in the measured TextStyle directly. The (symbol, fontFamily, density, tint, rtl) remember key on rememberMaterialSymbolPainter was already keyed on tint, so the TextMeasurer cache still hits for every (symbol, color) pair used by the app. --- .../commons/icons/symbols/MaterialSymbolPainter.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/icons/symbols/MaterialSymbolPainter.kt b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/icons/symbols/MaterialSymbolPainter.kt index 8854c6d26..64f7cfa29 100644 --- a/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/icons/symbols/MaterialSymbolPainter.kt +++ b/commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/icons/symbols/MaterialSymbolPainter.kt @@ -66,20 +66,22 @@ private class MaterialSymbolPainter( override fun DrawScope.onDraw() { val sizePx = size.minDimension val fontSize = with(density) { sizePx.toSp() } - // TextStyle omits color; we override at draw time so TextMeasurer's cache hits across tints. + // Bake the tint into the measured style. drawText(color = ...) override is unreliable + // across Compose versions when the measured style has Color.Unspecified — falls back to + // Color.Black and produces black-on-black icons. val layout = textMeasurer.measure( text = symbol.glyph, - style = TextStyle(fontFamily = fontFamily, fontSize = fontSize), + style = TextStyle(fontFamily = fontFamily, fontSize = fontSize, color = tint), ) val tx = (size.width - layout.size.width) / 2f val ty = (size.height - layout.size.height) / 2f if (symbol.autoMirror && rtl) { scale(scaleX = -1f, scaleY = 1f, pivot = Offset(size.width / 2f, size.height / 2f)) { - translate(tx, ty) { drawText(layout, color = tint) } + translate(tx, ty) { drawText(layout) } } } else { - translate(tx, ty) { drawText(layout, color = tint) } + translate(tx, ty) { drawText(layout) } } } }