-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Fixed: SearchHandler not displaying default search and clear icons #29981
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
[Android] Fixed: SearchHandler not displaying default search and clear icons #29981
Conversation
Hey there @@Tamilarasan-Paranthaman! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
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 ensures that Android’s SearchHandler
displays default search and clear icons when no custom icons are provided.
- Updated the Android handler to assign default icon resources if no custom image is set.
- Added a sample HostApp page to configure and trigger the
SearchHandler
. - Introduced a UI test to automate tapping the trigger and capturing a screenshot.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29973.cs | New UI test class that taps the trigger button and takes a screenshot |
src/Controls/tests/TestCases.HostApp/Issues/Issue29973.cs | HostApp sample initializing SearchHandler and a button to trigger it |
src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellSearchView.cs | Handler update: use default icon resources when no custom image set |
Comments suppressed due to low confidence (2)
src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellSearchView.cs:330
- Please update the public XML docs under /docs/ to describe that default SearchHandler icons are now assigned when no custom icons are provided, so documentation matches the new behavior.
else if (defaultImage != -1)
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29973.cs:21
- [nitpick] Consider adding an assertion to explicitly verify that the default search and clear icons are visible after invoking the handler, rather than relying solely on a screenshot comparison.
VerifyScreenshot();
else if (defaultImage != -1) | ||
{ | ||
// If the icon is not set, use the default icon | ||
result.SetImageResource(defaultImage); |
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.
Default icons set via SetImageResource lack a content description, which may hinder accessibility; consider calling AutomationPropertiesProvider.SetContentDescription with a suitable description for the default icons.
result.SetImageResource(defaultImage); | |
result.SetImageResource(defaultImage); | |
AutomationPropertiesProvider.SetContentDescription(result, "Default icon", null, null); |
Copilot uses AI. Check for mistakes.
/azp run MAUI-UITests-public |
Azure Pipelines successfully started running 1 pipeline(s). |
Fyi, a PR fixing the same bug was recently merged #25067 |
Closing in favour of #25067 |
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!
Root Cause of the issue
Description of Change
Issues Fixed
Fixes #29973
Tested the behaviour in the following platforms
Screenshot
Before-Fix.mov
After-Fix.mov