-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] SearchBar does not update colors on theme change - fix #30601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@kubaflo any comments on the Copilot review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue where SearchBar controls on Android do not update their colors when the device theme changes between light and dark modes. The fix ensures that SearchBar text, placeholder, and icon colors properly respond to theme changes by implementing proper theme change detection and color updates.
Key changes:
- Added theme change detection to SearchBar controls by subscribing to Application.RequestedThemeChanged events
- Enhanced SearchViewExtensions to properly handle default system colors and update search icon colors during theme changes
- Added UI test coverage to verify the theme change behavior works correctly
Reviewed Changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| SearchViewExtensions.cs | Enhanced color update methods to handle system default colors and search icon tinting during theme changes |
| SearchBarHandler.Android.cs | Added text color update call to the SearchView platform control |
| SearchBar.cs | Added theme change event subscription to trigger property updates when app theme changes |
| Issue30601.cs (HostApp) | Created UI test page demonstrating SearchBar theme change behavior with various color configurations |
| Issue30601.cs (Tests) | Added automated test to verify SearchBar colors update correctly on theme change |
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30601.cs
Outdated
Show resolved
Hide resolved
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30601.cs
Outdated
Show resolved
Hide resolved
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30601.cs
Outdated
Show resolved
Hide resolved
|
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/rebase |
1a5af22 to
3a55c91
Compare
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/rebase |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
3a55c91 to
e3bf11d
Compare
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Update SearchViewExtensions.cs Update SearchViewExtensions.cs Update SearchViewExtensions.cs Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Updated snapshots
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Issues Fixed
Fixes #30600
Fixes #25153
Screen.Recording.2025-07-13.at.19.44.33.mov
Screen.Recording.2025-07-13.at.19.36.48.mov