Revert "Fix SwipeItem IconImageSource color handling and rendering across platforms (#35632)" - #36887
Merged
Merged
Conversation
…ross platforms (#35632)" This reverts commit c78acfe38aa0b71b4bb50cdb2b28b95b1c3f5aa8. PR #35632 removed the automatic icon tinting from SwipeItem across Android, iOS and Windows so that image icons render with the colors defined in the source image. While that is a reasonable end state, it is a behavior change rather than a bug fix, and it regressed existing apps in a servicing release (see #36766). Reverting restores the pre-existing tinting behavior on the servicing line. The new behavior, plus an explicit opt-in SwipeItem.IconColor API, is being introduced for .NET 11 in #36884. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: cb2a11ab-30ba-4020-836a-3acccb5f58cc
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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!
Issue Details
This reverts #35632 ("Fix SwipeItem IconImageSource color handling and rendering across platforms") from the .NET 10 servicing line.
#35632 stopped auto-tinting
SwipeItem.IconImageSourcefor PNG/SVG sources, so those icons now render in their own colors instead of a contrast color derived from the item background. It shipped in 10.0.90 (SR9) and is causing #36766 — an SVG icon whose fill is#212121now renders black on a black swipe item in dark mode, i.e. effectively invisible.The change is a reasonable direction, but it is too breaking for a servicing release:
GetTextColor()picks white or black from background luminosity. Fix SwipeItem IconImageSource color handling and rendering across platforms #35632 removed that for PNG/SVG but left it in place for the item's label text, so the text is still contrast-corrected while the icon is not.proposal/openand asked for more configuration; what shipped was a behavior change with none. An affected app's only options today are pinning to 10.0.80 or re-authoring every SVG per theme.BackgroundColorcorrectly followAppThemeBinding. Before SR9 the stale light background accidentally preserved contrast; together the two changes produce black-on-black.SwipeViewRenderer.cs#L858) and iOS (SwipeViewRenderer.cs#L713).Description of Change
git revertof c78acfe, restoring the previous behavior on all platforms:SetColorFilter(GetTextColor(), SrcAtop)applied to every drawable againAlwaysTemplaterendering mode on every image again, withTintColor = fontImageSource.Color ?? GetTextColor()MapSourceAsyncback toToIconSource()(BitmapIconSource, whoseShowAsMonochromedefaults totrue); theLoadFileIconAsynchelper is removedThe
Issue23074host-app page, shared test,cancel_red.svgand theSwipeItemFontAndSvgIconsRenderCorrectlysnapshots are removed with it, and the SwipeView snapshots are restored to their pre-#35632 baselines.The revert is scoped strictly to #35632.
MapVisibilityon the Windows handler — added oninflight/candidateafter #35632 — is untouched.Conflict resolution note:
TestCases.iOS.Tests/snapshots/ios/VerifyCollectionViewContentWithIconImageSwipeItem.pngconflicted because #36202 re-saved it for iOS 18 after #35632 landed. That test's swipe item hasBackgroundColor = #6A5ACD(luminosity ≈ 0.40 → white), so with this revertgroceries.pngis tinted solid white again and the pre-#35632 baseline is the correct content. If iOS 18 CI shows drift unrelated to the tint, this one snapshot may need a re-save from the CI artifact.Follow-up
The behavior change itself is good and should ship — just in .NET 11 rather than servicing, paired with an explicit opt-in API so users get a real migration path instead of a silent rendering change in a patch release. That is #36884, which keeps the #35632 behavior and adds
SwipeItem.IconColor.Issues Fixed
Fixes #36766