Skip to content

feat(theme): wallpaper-derived dynamic accent for buttons - #1098

Merged
bmc08gt merged 1 commit into
code/cashfrom
feat/wallpaper-dynamic-accent
Jul 20, 2026
Merged

bmc08gt merged 1 commit into
code/cashfrom
feat/wallpaper-dynamic-accent

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Jul 20, 2026 •

Copy link
Copy Markdown
Collaborator

What

Adds rememberDynamicAccent() to :ui:theme — a small helper that returns the user's Material You (Monet) accent color derived from their wallpaper / system theme, à la Google Photos' Save action.

On Android 12+ it reads the palette via Material3's dynamicDarkColorScheme() (we're dark-only, so we always take the dark scheme) and returns its primary / onPrimary. Below API 31 it falls back to the brand colors you pass in.

val (accent, onAccent) = rememberDynamicAccent(
    fallbackAccent = CodeTheme.colors.secondary,
    fallbackOnAccent = CodeTheme.colors.onAction,
)
Button(colors = ButtonDefaults.buttonColors(containerColor = accent)) {
    Text("Save", color = onAccent)
}

First use: the currency creator's bill-customization action button (relabelled "Done" → "Next") now uses the system accent instead of a flat white pill.

Notes

  • Pulls compose-material3 into :ui:theme for the first time. This is the intended first step toward migrating the theme layer off the bespoke Material2-based color system onto Material3 — the natural follow-up is mapping the full dynamicDarkColorScheme into com.getcode.theme.ColorScheme at the DesignSystem(colorScheme = …) entry point so dynamic color can flow app-wide.
  • minSdk is 29, so the helper guards on Build.VERSION.SDK_INT >= S and falls back to brand colors on older devices.
  • No new manifest permissions required.

Testing

  • :ui:theme:compileDebugKotlin and :apps:flipcash:features:currency-creator:compileDebugKotlin both build clean (verified in an isolated worktree at this commit).

Add rememberDynamicAccent(), which reads the user's Material You (Monet)
palette via Material3 dynamicDarkColorScheme() on Android 12+ and falls
back to brand colors below API 31. Pulls compose-material3 into :ui:theme
as the first step toward a broader Material3 migration.

Use it to color the currency creator's bill-customization action button
(now "Next") with the system accent, à la Google Photos' save action.

Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
@github-actions github-actions Bot added type: feature New functionality area: ui Compose UI, theme, components, resources and removed type: feature New functionality labels Jul 20, 2026
@bmc08gt
bmc08gt merged commit 09f9d7b into code/cash Jul 20, 2026
3 checks passed
@bmc08gt
bmc08gt deleted the feat/wallpaper-dynamic-accent branch July 20, 2026 18:06
bmc08gt added a commit that referenced this pull request Jul 24, 2026
Add rememberDynamicAccent(), which reads the user's Material You (Monet)
palette via Material3 dynamicDarkColorScheme() on Android 12+ and falls
back to brand colors below API 31. Pulls compose-material3 into :ui:theme
as the first step toward a broader Material3 migration.

Use it to color the currency creator's bill-customization action button
(now "Next") with the system accent, à la Google Photos' save action.

Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ui Compose UI, theme, components, resources

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant