Skip to content

Use tertiaryContainer color role for antiandrogen medication event items#26

Merged
NaiveTomcat merged 2 commits into
masterfrom
copilot/modify-medication-event-item
Mar 11, 2026
Merged

Use tertiaryContainer color role for antiandrogen medication event items#26
NaiveTomcat merged 2 commits into
masterfrom
copilot/modify-medication-event-item

Conversation

Copilot AI commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

Antiandrogen medication event items were using secondaryFixedDim as their container color, with no explicit on-colors for text/icons. This switches them to the tertiaryContainer role with a full set of M3-compliant on-colors providing proper contrast in both light and dark themes.

Color scheme changes (antiandrogen items only)

Element Before After
Container secondaryFixedDim tertiaryContainer
Leading icon tertiary onTertiaryContainer
Headline (M3 default) onTertiaryContainer
Overline (route label) (M3 default) onTertiaryFixedVariant
Trailing time (M3 default) onTertiaryFixed
Trailing date (M3 default) onTertiaryFixedVariant

Non-antiandrogen items are unchanged.

Implementation

Two separate ListItemDefaults.colors() calls replace the previous single call, avoiding passing Color.Unspecified into M3 token slots:

val listItemColors = if (isAntiAndrogen) {
    ListItemDefaults.colors(
        containerColor = MaterialTheme.colorScheme.tertiaryContainer,
        leadingIconColor = MaterialTheme.colorScheme.onTertiaryContainer,
        headlineColor = MaterialTheme.colorScheme.onTertiaryContainer,
        overlineColor = MaterialTheme.colorScheme.onTertiaryFixedVariant,
    )
} else {
    ListItemDefaults.colors(
        containerColor = MaterialTheme.colorScheme.secondaryContainer,
        leadingIconColor = MaterialTheme.colorScheme.tertiary,
    )
}

Trailing text colors are handled separately via Text(color = ...) since they live outside ListItem's slot color system, using onTertiaryFixed (time) and onTertiaryFixedVariant (date) for antiandrogen items, Color.Unspecified otherwise.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: NaiveTomcat <50436951+NaiveTomcat@users.noreply.github.com>
Copilot AI changed the title [WIP] Update container color for antiandrogens in medication event item Use tertiaryContainer color role for antiandrogen medication event items Mar 11, 2026
@NaiveTomcat NaiveTomcat marked this pull request as ready for review March 11, 2026 05:26
@NaiveTomcat NaiveTomcat merged commit 3526524 into master Mar 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants