-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android, iOS, MacOS] Fixed Entry ClearButton Color Not Updating on AppThemeBinding Change #30817
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, iOS, MacOS] Fixed Entry ClearButton Color Not Updating on AppThemeBinding Change #30817
Conversation
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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 a bug where the Entry control's clear button color does not update when the app theme changes on Android, iOS, and macOS platforms. The issue occurred because the clear button icon color was not being refreshed when the text color changed due to AppThemeBinding updates.
Key changes implemented:
- Added a new method to update clear button color on Android when text color changes
- Modified Entry handlers on iOS and macOS to call the clear button color update method when text color changes
- Refactored Android clear button color logic to use the new extension method
Reviewed Changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/Core/src/Platform/Android/EditTextExtensions.cs |
Added new UpdateClearButtonColor method to handle clear button icon color updates |
src/Core/src/Handlers/Entry/EntryHandler.iOS.cs |
Modified MapTextColor to call clear button color update when clear button is visible |
src/Core/src/Handlers/Entry/EntryHandler.Android.cs |
Updated MapTextColor and ShowClearButton to use the new color update method |
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19997.cs |
Added UI test to verify clear button color updates on theme change |
src/Controls/tests/TestCases.HostApp/Issues/Issue19997.cs |
Created test page with Entry using AppThemeBinding and theme toggle button |
Comments suppressed due to low confidence (1)
src/Core/src/Handlers/Entry/EntryHandler.Android.cs:86
- [nitpick] The variable name 'platformHandler' is misleading since 'handler' is already the platform handler. Consider renaming to 'entryHandler' or 'concreteHandler' for clarity.
if (handler is EntryHandler platformHandler && platformHandler._clearButtonVisible)
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19997.cs
Outdated
Show resolved
Hide resolved
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19997.cs
Outdated
Show resolved
Hide resolved
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19997.cs
Outdated
Show resolved
Hide resolved
5944910 to
588d9ee
Compare
|
/rebase |
|
Azure Pipelines successfully started running 1 pipeline(s). |
2 similar comments
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Azure Pipelines successfully started running 1 pipeline(s). |
040c4ee to
94e158c
Compare
Added the fix for android platform Remove unwanted code changes Updated the code changes Updated the code changes Updated the fix Updated the code changes Added the test case Added the output images Updated the test case Updated the fix Added the pending snapshots Updated the test case Added the updated output images for mac and windows platform Added the output images for entry feature matrix test case
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!
Issue Details
Root cause
Description of Change
Validated the behaviour in the following platforms
Issues Fixed
Fixes #19997
Fixes #31326
Output images
Android
Before_Android.mov
After_Android.mov
iOS
Before_iOS.mov
After_iOS.mov
macOS
Before_macOS.mov
After_macOS.mov