⭐
Log in to mark this repository.
Android: stop Material filling the unset colour slots with its own purple
c598503 · Gabriel Morell · 2026-09-19 00:17
Message
{commit_body(@commit)}
Files changed
modified
android/app/src/main/java/org/neiam/dms/app/ui/theme/AppTheme.kt
+24
−0
@@ -73,6 +73,18 @@ data class AppTheme(
| 73 | 73 | // it to `primary` so the theme's accent shows up at higher |
| 74 | 74 | // elevations rather than a generic purple. |
| 75 | 75 | surfaceTint = primary, |
| 76 | + // The rest of Material's slots, which it otherwise fills from its | |
| 77 | + // own baseline palette -- and that baseline is purple and dusty | |
| 78 | + // pink, so they show up as exactly the colours the theme does not | |
| 79 | + // contain. secondaryContainer is the one that bites: it paints the | |
| 80 | + // selected NavigationBar pill and selected chips, so a themed app | |
| 81 | + // with a bottom bar shows a purple pill on every theme. | |
| 82 | + secondaryContainer = primary, onSecondaryContainer = bg, | |
| 83 | + tertiary = accent, onTertiary = bg, | |
| 84 | + tertiaryContainer = cardBg, onTertiaryContainer = content, | |
| 85 | + inversePrimary = primary, | |
| 86 | + inverseSurface = content, inverseOnSurface = bg, | |
| 87 | + surfaceBright = cardBg, surfaceDim = bg, | |
| 76 | 88 | outline = dim, outlineVariant = dim.copy(alpha = 0.35f), |
| 77 | 89 | ) |
| 78 | 90 | } else { |
@@ -89,6 +101,18 @@ data class AppTheme(
| 89 | 101 | surfaceContainerHigh = cardBg, |
| 90 | 102 | surfaceContainerHighest = cardBg, |
| 91 | 103 | surfaceTint = primary, |
| 104 | + // The rest of Material's slots, which it otherwise fills from its | |
| 105 | + // own baseline palette -- and that baseline is purple and dusty | |
| 106 | + // pink, so they show up as exactly the colours the theme does not | |
| 107 | + // contain. secondaryContainer is the one that bites: it paints the | |
| 108 | + // selected NavigationBar pill and selected chips, so a themed app | |
| 109 | + // with a bottom bar shows a purple pill on every theme. | |
| 110 | + secondaryContainer = primary, onSecondaryContainer = bg, | |
| 111 | + tertiary = accent, onTertiary = bg, | |
| 112 | + tertiaryContainer = cardBg, onTertiaryContainer = content, | |
| 113 | + inversePrimary = primary, | |
| 114 | + inverseSurface = content, inverseOnSurface = bg, | |
| 115 | + surfaceBright = cardBg, surfaceDim = bg, | |
| 92 | 116 | outline = dim, outlineVariant = dim.copy(alpha = 0.35f), |
| 93 | 117 | ) |
| 94 | 118 | } |
Parents: b3cf971