[Android] SearchBar does not update colors on theme change - fix#30601
Merged
jfversluis merged 7 commits intodotnet:inflight/currentfrom Sep 2, 2025
Merged
[Android] SearchBar does not update colors on theme change - fix#30601jfversluis merged 7 commits intodotnet:inflight/currentfrom
jfversluis merged 7 commits intodotnet:inflight/currentfrom
Conversation
Contributor
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
jsuarezruiz
suggested changes
Jul 14, 2025
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
|
@kubaflo any comments on the Copilot review? |
Contributor
There was a problem hiding this comment.
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
jfversluis
reviewed
Aug 29, 2025
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30601.cs
Outdated
Show resolved
Hide resolved
jfversluis
reviewed
Aug 29, 2025
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30601.cs
Outdated
Show resolved
Hide resolved
jfversluis
reviewed
Aug 29, 2025
|
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
|
/rebase |
1a5af22 to
3a55c91
Compare
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
|
/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). |
jfversluis
approved these changes
Sep 2, 2025
PureWeen
pushed a commit
that referenced
this pull request
Sep 8, 2025
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
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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