CommunityToolkit / CommunityToolkit/Maui
[BUG] Trimmed: BackgroundColor with Theme
- Dominant language
- C#
- Stars
- 2.7k
- Forks
- 500
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 7
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Did you read the "Reporting a bug" section on Contributing file?
- [x] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug
### Current Behavior
When I build the MAUI Android app in Release mode, the BackgroundColor and TextColor binding properties are not handled via the theme.
### Expected Behavior
The BackgroundColor and TextColor properties should use the theme-based colors defined via AppThemeColor, but instead, they are defaulting to the default values.
### Steps To Reproduce
1. Create a MAUI project
2. Add the Community Toolkit MAUI library
3. On the Main page, add a Border and a style that sets the background color using AppThemeColor
4. Build in Debug and then in Release
### Link to public reproduction project repository
Needs reproduction
### Environment
```markdown
- .NET MAUI CommunityToolkit: 15.0.1
- OS: Android 12
- .NET MAUI: 10.0.101
- .NET Core: 10
```
### Anything else?
WORKAROUND => Added to the project file ``````
Contributor guide
Research direction
Start by reproducing the reported behavior in a .NET MAUI Android app, comparing Debug and Release builds with a Border style using AppThemeColor on the Main page. Investigate the project file and the CommunityToolkit.Maui trimming behavior, using the TrimmerRootAssembly workaround as a clue. Done means BackgroundColor and TextColor bindings use the theme-based colors in Release without requiring that workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, csharp
- Domain
- build-system, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100