Repository navigation
Add day and night colors, and default to a Material 3 DayNight theme - #137
Merged
freakboy3742 merged 2 commits intoDec 2, 2026
Merged
Conversation
The primary_color, primary_color_dark and accent_color settings, and the new primary_text_color setting, can each be a single color used in both modes, or a table with "day" and "night" values. Night values are written to values-night/colors.xml. primary_text_color sets colorOnPrimary, the text color on buttons filled with the primary color. It defaults to white, so buttons stay readable in dark mode. The default base theme is now Theme.Material3.DayNight, and the Material library is always included.
freakboy3742
left a comment
Member
There was a problem hiding this comment.
These changes all make sense; the only questions relate to bigger picture issues raised on the matching Briefcase PR:
- Whether the surface color should be customizable
- Whether material should be promoted to this template
3 tasks done
freakboy3742
approved these changes
Dec 2, 2026
freakboy3742
left a comment
Member
There was a problem hiding this comment.
Following the discussion on the Briefcase ticket, I've reverted some of the proposed changes in favour of explicit configuration on the Briefcase side; otherwise, this looks great - thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Toga's Android backend is moving to Material 3, and Briefcase's Toga bootstrap is moving to a
Theme.Material3.DayNighttheme. In dark mode, that theme expects a light primary color, and uses dark text (#381E72) on buttons filled with it. This template always setscolorPrimaryto the app'sprimary_color(#008577by default), so in dark mode those buttons get dark text on a dark fill.This PR:
primary_color,primary_color_darkandaccent_colorbe either a single color, used in both light and dark mode, or a table withdayandnightvalues, such asprimary_color = {day = "#5B2A8C", night = "#D4BBFF"}. Night values are written to a newvalues-night/colors.xml. A table needs both keys. If one is missing,briefcase createfails with a configuration error.primary_text_color, which setscolorOnPrimaryand takes the same forms. It defaults to#FFFFFF, so these buttons are readable in dark mode with no configuration.base_themefromTheme.AppCompat.Light.DarkActionBartoTheme.Material3.DayNight.com.google.android.material:material:1.13.0, next to the AppCompat dependency the template already adds.colorOnPrimaryis defined by the Material library, so including it keeps every app building, whatever its theme.Effect on existing apps, checked on an Android 15 emulator in light and dark mode:
base_themeand uses single colors looks the same. An app withTheme.AppCompat.Light.DarkActionBarand released Toga 0.5 was pixel-identical with the old and new template, in both modes.base_themegetsTheme.Material3.DayNightat its nextbriefcase create. With Toga 0.5 it stays readable in both modes, but it looks different: the app bar no longer uses the primary color, and the app follows dark mode.Generating a full Material 3 color scheme from a seed color is a possible later alternative, tracked in beeware/briefcase#3167.
Note: Briefcase change
beeware/briefcase#3168 documents these settings and updates the Toga bootstrap. Because this template now provides the theme and the Material library, the bootstrap no longer sets
base_themeor lists the Material dependency. beeware/briefcase#3168 must merge together with or after this PR. Otherwise, new Toga apps would get an AppCompat theme without the Material library.PR Checklist:
Assisted-by: Claude Code (Claude Opus 5.5)