[Android] Gradient background with ImageButton#26297
[Android] Gradient background with ImageButton#26297jfversluis merged 2 commits intodotnet:inflight/currentfrom
Conversation
|
Hey there @kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
/rebase |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
jfversluis
left a comment
There was a problem hiding this comment.
Still see a relevant test failure
VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: GradientBackgroundShouldWorkWithImageButton.png (size differs - baseline is 1920x1080 pixels, actual is 789x563 pixels)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where ImageButton controls on Android were not properly displaying gradient backgrounds, showing solid colors instead of the expected gradients. The fix involves updating the background when the ImageButton's layout changes.
- Adds a layout change event handler to the Android ImageButton handler to trigger background updates
- Includes comprehensive UI tests to verify gradient background functionality
- Tests both RadialGradientBrush and LinearGradientBrush with ImageButton and Button controls
Reviewed Changes
Copilot reviewed 4 out of 8 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/Core/src/Handlers/ImageButton/ImageButtonHandler.Android.cs |
Adds layout change event handling to properly update gradient backgrounds on Android |
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue23119.cs |
Implements automated UI test to verify gradient background rendering |
src/Controls/tests/TestCases.HostApp/Issues/Issue23119.xaml.cs |
Creates test page code-behind for the gradient background issue reproduction |
src/Controls/tests/TestCases.HostApp/Issues/Issue23119.xaml |
Defines XAML test page with various gradient background scenarios for validation |
|
Azure Pipelines successfully started running 3 pipeline(s). |
* Gradient background with ImageButton * Update GradientBackgroundShouldWorkWithImageButton.png
* Gradient background with ImageButton * Update GradientBackgroundShouldWorkWithImageButton.png
* Gradient background with ImageButton * Update GradientBackgroundShouldWorkWithImageButton.png
* Gradient background with ImageButton * Update GradientBackgroundShouldWorkWithImageButton.png
Issues Fixed
Fixes #23119