Android: stop Material filling the unset colour slots with its own purple

863808d · Gabriel Morell · 2026-09-19 00:17

12 files +24 -0
Message
{commit_body(@commit)}

Files changed

modified android/app/src/main/java/org/neiam/feedpug/app/ui/theme/AppTheme.kt
+24 −0
@@ -66,6 +66,18 @@ data class AppTheme(
66 66 surfaceContainerHigh = cardBg,
67 67 surfaceContainerHighest = cardBg,
68 68 surfaceTint = primary,
69 + // The rest of Material's slots, which it otherwise fills from its
70 + // own baseline palette -- and that baseline is purple and dusty
71 + // pink, so they show up as exactly the colours the theme does not
72 + // contain. secondaryContainer is the one that bites: it paints the
73 + // selected NavigationBar pill and selected chips, so a themed app
74 + // with a bottom bar shows a purple pill on every theme.
75 + secondaryContainer = primary, onSecondaryContainer = bg,
76 + tertiary = accent, onTertiary = bg,
77 + tertiaryContainer = cardBg, onTertiaryContainer = content,
78 + inversePrimary = primary,
79 + inverseSurface = content, inverseOnSurface = bg,
80 + surfaceBright = cardBg, surfaceDim = bg,
69 81 outline = dim, outlineVariant = dim.copy(alpha = 0.35f),
70 82 )
71 83 } else {
@@ -82,6 +94,18 @@ data class AppTheme(
82 94 surfaceContainerHigh = cardBg,
83 95 surfaceContainerHighest = cardBg,
84 96 surfaceTint = primary,
97 + // The rest of Material's slots, which it otherwise fills from its
98 + // own baseline palette -- and that baseline is purple and dusty
99 + // pink, so they show up as exactly the colours the theme does not
100 + // contain. secondaryContainer is the one that bites: it paints the
101 + // selected NavigationBar pill and selected chips, so a themed app
102 + // with a bottom bar shows a purple pill on every theme.
103 + secondaryContainer = primary, onSecondaryContainer = bg,
104 + tertiary = accent, onTertiary = bg,
105 + tertiaryContainer = cardBg, onTertiaryContainer = content,
106 + inversePrimary = primary,
107 + inverseSurface = content, inverseOnSurface = bg,
108 + surfaceBright = cardBg, surfaceDim = bg,
85 109 outline = dim, outlineVariant = dim.copy(alpha = 0.35f),
86 110 )
87 111 }

Parents: 15512d0