Repository navigation
Use Material dividers on Android - #4922
Merged
Merged
Conversation
Android buttons are now MaterialButtons, so they follow the app's Material theme. Background colours are applied as a tint. The Android backend now requires the Material library, and warns at startup when the app uses a Material 2 theme.
The testbed now uses Theme.Material3.DayNight, the theme Toga's Android backend requires.
Material 3 is now a requirement of the Android backend as a whole, so the Button docs don't need to repeat it.
The examples, and the Positron FastAPI bootstrap, used the Material 2 Theme.MaterialComponents.Light.DarkActionBar theme. They now use Theme.Material3.DayNight, as the testbed does.
A Material button has 24dp of padding at each side, so the fixed 68px width Toga gave icon buttons cut off the right side of the icon. Measure icon buttons natively, like text buttons, so the size includes the icon and its padding, and remove the gap Material leaves between an icon and the text, which put the icon off center.
Android dividers are now MaterialDividers, so they use the divider color from the app's Material 3 theme, rather than a fixed light gray.
freakboy3742
approved these changes
Dec 4, 2026
freakboy3742
left a comment
Member
There was a problem hiding this comment.
👍 Pretty straightforward - 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.
Refs #2250.
On Android,
Divideris now a MaterialMaterialDivider, so it uses the divider color from the app's Material 3 theme (which follows light and dark mode), rather than a fixed light gray.MaterialDividerdraws a line that fills the view, so a narrow, tall view still gives a vertical divider. Toga already sizes the divider to 1dp across, which is the Material 3 thickness.Verified with the full Android testbed on an API 31 emulator (
beePhone): 514 passed, 99 skipped, 56 xfailed, 6 xpassed, with 100.0% coverage.PR Checklist:
Assisted-by: Claude Code (Claude Opus 5.5)