-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed Extra Padding on iOS buttons required when image on top or bott…
…om (#26018) * Fixed the extra padding issue for button * Added test cases * Committed the images * Committed the failed case images * Committed the images * Modified the logics based on the border width * Committed the failure image * Modified a breaking image * add UITest image * another screenshot * another screenshot --------- Co-authored-by: Shalini-Ashokan <[email protected]> Co-authored-by: tj-devel709 <[email protected]>
- Loading branch information
1 parent
ba0a016
commit be9e92c
Showing
29 changed files
with
116 additions
and
19 deletions.
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.