-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fixed Extra Padding on iOS buttons required when image on top or bottom #26018
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
cdf2170
Fixed the extra padding issue for button
Shalini-Ashokan 148032e
Added test cases
Shalini-Ashokan 5447b48
Committed the images
Shalini-Ashokan e959def
Committed the failed case images
Shalini-Ashokan 3c9a684
Committed the images
Shalini-Ashokan ff9368d
Modified the logics based on the border width
Shalini-Ashokan bee20f0
Committed the failure image
Shalini-Ashokan 1b25082
Modified a breaking image
Shalini-Ashokan fea9307
add UITest image
tj-devel709 b4146c4
another screenshot
tj-devel709 6db32ea
another screenshot
tj-devel709 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
This file contains 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
Binary file added
BIN
+150 KB
...ests/TestCases.Android.Tests/snapshots/android/RemoveExtraPaddingFromButton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions
64
src/Controls/tests/TestCases.HostApp/Issues/Issue25489.xaml
This file contains 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,64 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Class="Maui.Controls.Sample.Issues.Issue25489" | ||
Title="Issue25489"> | ||
|
||
<VerticalStackLayout> | ||
<HorizontalStackLayout> | ||
<Button Text="Hello, longer world!" | ||
ImageSource="dotnet_bot_resized2.png" | ||
Background="lightgray" | ||
ContentLayout="Top,0"/> | ||
</HorizontalStackLayout> | ||
|
||
<HorizontalStackLayout> | ||
<Button Text="Hello, longer world!" | ||
ImageSource="dotnet_bot_resized2.png" | ||
Background="lightgreen" | ||
ContentLayout="Bottom,0"/> | ||
</HorizontalStackLayout> | ||
|
||
<HorizontalStackLayout> | ||
<Button Text="Hello, longer world!" | ||
ImageSource="dotnet_bot_resized2.png" | ||
Background="lightblue" | ||
ContentLayout="Left,0"/> | ||
</HorizontalStackLayout> | ||
|
||
<HorizontalStackLayout> | ||
<Button Text="Hello, longer world!" | ||
ImageSource="dotnet_bot_resized2.png" | ||
Background="purple" | ||
ContentLayout="Right,0"/> | ||
</HorizontalStackLayout> | ||
|
||
<Button Text="Hello, longer world!" | ||
ImageSource="dotnet_bot_resized2.png" | ||
Background="lightgray" | ||
ContentLayout="Bottom,0" | ||
HorizontalOptions="Center"/> | ||
|
||
<Button Text="Hello, longer world!" | ||
ImageSource="dotnet_bot_resized2.png" | ||
Padding="0" | ||
Background="lightgreen" | ||
ContentLayout="Bottom,0" | ||
HorizontalOptions="Center"/> | ||
|
||
<Button Text="Hello, longer world!" | ||
ImageSource="dotnet_bot_resized2.png" | ||
Padding="5" | ||
Background="lightblue" | ||
ContentLayout="Bottom,0" | ||
HorizontalOptions="Center"/> | ||
|
||
<Button Text="Hello, longer world!" | ||
ImageSource="dotnet_bot_resized2.png" | ||
Padding="50,10" | ||
Background="purple" | ||
ContentLayout="Bottom,0" | ||
HorizontalOptions="Center"/> | ||
|
||
</VerticalStackLayout> | ||
</ContentPage> |
10 changes: 10 additions & 0 deletions
10
src/Controls/tests/TestCases.HostApp/Issues/Issue25489.xaml.cs
This file contains 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,10 @@ | ||
namespace Maui.Controls.Sample.Issues; | ||
|
||
[Issue(IssueTracker.Github, 25489, "Remove extra padding from the iOS button", PlatformAffected.All)] | ||
public partial class Issue25489 : ContentPage | ||
{ | ||
public Issue25489() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25489.cs
This file contains 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 Issue25489 : _IssuesUITest | ||
{ | ||
public Issue25489(TestDevice testDevice) : base(testDevice) | ||
{ | ||
} | ||
|
||
public override string Issue => "Remove extra padding from the iOS button"; | ||
|
||
[Test] | ||
[Category(UITestCategories.Button)] | ||
public void RemoveExtraPaddingFromButton() | ||
{ | ||
VerifyScreenshot(); | ||
} | ||
} | ||
} |
Binary file added
BIN
+34.8 KB
.../tests/TestCases.WinUI.Tests/snapshots/windows/RemoveExtraPaddingFromButton.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 modified
BIN
-144 Bytes
(100%)
...estCases.iOS.Tests/snapshots/ios/ButtonLayoutResizesWithImagePositionBottom.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 modified
BIN
-141 Bytes
(100%)
...s/TestCases.iOS.Tests/snapshots/ios/ButtonLayoutResizesWithImagePositionTop.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 modified
BIN
-42 Bytes
(100%)
...rols/tests/TestCases.iOS.Tests/snapshots/ios/ButtonPaddingIsAddedWhenNeeded.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 modified
BIN
-16.2 KB
(94%)
...stCases.iOS.Tests/snapshots/ios/ButtonResizesWhenTitleOrImageChangesAltered.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 modified
BIN
+9.45 KB
(100%)
...tCases.iOS.Tests/snapshots/ios/ButtonResizesWhenTitleOrImageChangesOriginal.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 modified
BIN
-4.46 KB
(87%)
...tCases.iOS.Tests/snapshots/ios/ButtonTitleFillsSpaceWhenImageChangesAltered.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 modified
BIN
+5.01 KB
(110%)
...Cases.iOS.Tests/snapshots/ios/ButtonTitleFillsSpaceWhenImageChangesOriginal.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 modified
BIN
+2.23 KB
(100%)
...s.iOS.Tests/snapshots/ios/ButtonsLayoutResolveWhenParentSizeChangesOriginal.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 modified
BIN
+2.22 KB
(100%)
....iOS.Tests/snapshots/ios/ButtonsLayoutResolveWhenParentSizeChangesOriginal2.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 modified
BIN
+4.22 KB
(110%)
...pshots/ios/ButtonsLayoutResolveWhenParentSizeChangesSizeButtonsDownPortrait.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 modified
BIN
-172 Bytes
(100%)
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Issue22433_Default.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 modified
BIN
-36 Bytes
(100%)
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Issue22433_Layout.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 modified
BIN
-92 Bytes
(100%)
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Issue22433_Spacing.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
+163 KB
...ntrols/tests/TestCases.iOS.Tests/snapshots/ios/RemoveExtraPaddingFromButton.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 modified
BIN
+809 Bytes
(100%)
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/VerifyButtonPage1_Border.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 modified
BIN
+827 Bytes
(100%)
...Controls/tests/TestCases.iOS.Tests/snapshots/ios/VerifyButtonPage1_NoBorder.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 modified
BIN
-636 Bytes
(99%)
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/VerifyButtonPage3.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 modified
BIN
+957 Bytes
(100%)
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/VerifyButtonPage4.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 modified
BIN
+348 Bytes
(100%)
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/VerifyButtonPage6.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 modified
BIN
-310 Bytes
(100%)
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/VerifyButtonPage7.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 modified
BIN
-68 Bytes
(100%)
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/VerifyButtonPage8_Center.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 modified
BIN
+11.8 KB
(110%)
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/VerifyButtonPage8_End.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 modified
BIN
+10.1 KB
(110%)
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/VerifyButtonPage8_Start.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 change will impact to several tests:

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.
Changes in the screenshot tests should be expected if this is working correctly so that is not necessarily a bad thing :)
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.
@tj-devel709 , @jsuarezruiz I have attached the button failure images also. Could you please check it?