-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix ImageButton not rendering correctly based on its bounds #28309
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
Open
Shalini-Ashokan
wants to merge
10
commits into
dotnet:main
Choose a base branch
from
Shalini-Ashokan:fix-25558
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ebd101b
Fixed the image scale issue on android
Shalini-Ashokan a4e2a5c
Revert "Fixed the image scale issue on android"
Shalini-Ashokan d7d022a
Fixed the image scale issue on android
Shalini-Ashokan 3a03fc1
Fixed the image button aspect scenarios
Shalini-Ashokan ad28a05
Added test cases and committed the images
Shalini-Ashokan 7e048ab
Addressed a review concerns
Shalini-Ashokan 165f683
Commited the image and modified the test case
Shalini-Ashokan b8662df
Modified the test case
Shalini-Ashokan a09561b
Committed the failure image
Shalini-Ashokan af2e61c
Committed the windows image
Shalini-Ashokan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file modified
BIN
-832 Bytes
(100%)
src/Controls/tests/TestCases.Android.Tests/snapshots/android/Issue18242Test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+82.8 KB
...estCases.Android.Tests/snapshots/android/Issue25558VerifyImageButtonAspects.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| namespace Maui.Controls.Sample.Issues; | ||
|
|
||
| [Issue(IssueTracker.Github, 25558, "ImageButton does not scale Image correctly", PlatformAffected.Android)] | ||
| public class Issue25558 : ContentPage | ||
| { | ||
| public Issue25558() | ||
| { | ||
| var verticalStackLayout = new VerticalStackLayout | ||
| { | ||
| Padding = 10 | ||
| }; | ||
|
|
||
| var imageButton = new ImageButton | ||
| { | ||
| AutomationId = "imageButton", | ||
| Source = "groceries.png", | ||
| BackgroundColor = Colors.Blue | ||
| }; | ||
|
|
||
| verticalStackLayout.Add(imageButton); | ||
| Content = verticalStackLayout; | ||
| } | ||
| } |
Binary file added
BIN
+29.1 KB
.../tests/TestCases.Mac.Tests/snapshots/mac/Issue25558VerifyImageButtonAspects.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions
22
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25558.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
|
||
| public class Issue25558 : _IssuesUITest | ||
| { | ||
| public override string Issue => "ImageButton does not scale Image correctly"; | ||
|
|
||
| public Issue25558(TestDevice device) : base(device) | ||
| { | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.ImageButton)] | ||
| public void Issue25558VerifyImageButtonAspects() | ||
| { | ||
| App.WaitForElement("imageButton"); | ||
| VerifyScreenshot(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jsuarezruiz, I have committed the image. |
||
| } | ||
| } | ||
Binary file added
BIN
+20.9 KB
.../TestCases.WinUI.Tests/snapshots/windows/Issue25558VerifyImageButtonAspects.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+79.2 KB
.../tests/TestCases.iOS.Tests/snapshots/ios/Issue25558VerifyImageButtonAspects.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Oops, something went wrong.
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.

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.
This test is failing on Windows:
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.
@jsuarezruiz, I have modified the test to resolve the failing.