-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fixed the Label not sized correctly on Android #28215
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
20d490f
Fixed the Label Width issue on Android
Ahamed-Ali 896a7b0
Added the test case and sample
Ahamed-Ali f5d95bf
Removed the wrong screenshots
Ahamed-Ali d9daff1
Committed the correct image
Ahamed-Ali d99e097
Added windows snap
Ahamed-Ali c808c41
Committed the mac snapshots
Ahamed-Ali e919d77
Fixed the Label Width issue on Android
Ahamed-Ali 5556d43
Added the test case and sample
Ahamed-Ali 18eda72
Removed the wrong screenshots
Ahamed-Ali cc72456
Committed the correct image
Ahamed-Ali d7f4b08
Added windows snap
Ahamed-Ali 48b71e0
Committed the mac snapshots
Ahamed-Ali 55fc0a1
Merge branch 'fix-27614' of https://github.com/Ahamed-Ali/maui into f…
Ahamed-Ali 8f57386
Modified the test sample and images
Ahamed-Ali 3046695
Committed the pending snaps
Ahamed-Ali 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 added
BIN
+84.1 KB
...s/snapshots/android/LabelShouldSizeCorrectlyOnHorizontalCenterLayoutOptions.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
+84.1 KB
...ests/snapshots/android/LabelShouldSizeCorrectlyOnHorizontalEndLayoutOptions.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
+84.1 KB
...ts/snapshots/android/LabelShouldSizeCorrectlyOnHorizontalStartLayoutOptions.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
+24 Bytes
(100%)
...TestCases.Android.Tests/snapshots/android/WordWrapLineBreakModeNoExtraSpace.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,61 @@ | ||
| namespace Maui.Controls.Sample.Issues | ||
| { | ||
| [Issue(IssueTracker.Github, 27614, "Label not sized correctly on Android", PlatformAffected.Android)] | ||
| public class Issue27614 : ContentPage | ||
| { | ||
| public Issue27614() | ||
| { | ||
|
|
||
| var singleLineLabel = new Label | ||
| { | ||
| HorizontalOptions = LayoutOptions.Start, | ||
| AutomationId = "Label", | ||
| Margin = new Thickness(5, 5), | ||
| Text = "Hello World", | ||
| BackgroundColor = Colors.Blue, | ||
| TextColor = Colors.Black, | ||
| FontSize = 20 | ||
| }; | ||
|
|
||
| var multiLineLabel = new Label | ||
| { | ||
| HorizontalOptions = LayoutOptions.Start, | ||
| Margin = new Thickness(5, 5), | ||
| Text = "NET MAUI is a framework used to build native, cross-platform desktop and mobile apps from a single C# codebase for Android, iOS, Mac, and Windows", | ||
| BackgroundColor = Colors.Orchid, | ||
| TextColor = Colors.Black, | ||
| FontSize = 20 | ||
| }; | ||
|
|
||
| var button = new Button | ||
| { | ||
| Text = "Change Label HorizontalOptions to Center", | ||
| AutomationId = "CenterButton", | ||
| Margin = new Thickness(5, 5) | ||
|
|
||
| }; | ||
| button.Clicked += (s, e) => | ||
| { | ||
| singleLineLabel.HorizontalOptions = LayoutOptions.Center; | ||
| multiLineLabel.HorizontalOptions = LayoutOptions.Center; | ||
| }; | ||
| var button1 = new Button | ||
| { | ||
| Text = "Change Label HorizontalOptions to End", | ||
| AutomationId = "EndButton", | ||
| Margin = new Thickness(5, 5) | ||
| }; | ||
| button1.Clicked += (s, e) => | ||
| { | ||
| singleLineLabel.HorizontalOptions = LayoutOptions.End; | ||
| multiLineLabel.HorizontalOptions = LayoutOptions.End; | ||
| }; | ||
| var layout = new VerticalStackLayout | ||
| { | ||
| Children = { singleLineLabel, multiLineLabel, button, button1 } | ||
| }; | ||
|
|
||
| Content = layout; | ||
| } | ||
| } | ||
| } |
Binary file added
BIN
+43.7 KB
...Tests/snapshots/mac/LabelShouldSizeCorrectlyOnHorizontalCenterLayoutOptions.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
+41.5 KB
...ac.Tests/snapshots/mac/LabelShouldSizeCorrectlyOnHorizontalEndLayoutOptions.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
+41.7 KB
....Tests/snapshots/mac/LabelShouldSizeCorrectlyOnHorizontalStartLayoutOptions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions
41
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27614.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,41 @@ | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues | ||
| { | ||
| public class Issue27614 : _IssuesUITest | ||
| { | ||
| public Issue27614(TestDevice testDevice) : base(testDevice) | ||
| { | ||
| } | ||
|
|
||
| public override string Issue => "Label not sized correctly on Android"; | ||
|
|
||
| [Test, Order(1)] | ||
| [Category(UITestCategories.Label)] | ||
| public void LabelShouldSizeCorrectlyOnHorizontalStartLayoutOptions() | ||
| { | ||
| App.WaitForElement("Label"); | ||
| VerifyScreenshot(); | ||
| } | ||
|
|
||
| [Test, Order(2)] | ||
| [Category(UITestCategories.Label)] | ||
| public void LabelShouldSizeCorrectlyOnHorizontalCenterLayoutOptions() | ||
| { | ||
| App.WaitForElement("CenterButton"); | ||
| App.Tap("CenterButton"); | ||
| VerifyScreenshot(); | ||
| } | ||
|
|
||
| [Test, Order(3)] | ||
| [Category(UITestCategories.Label)] | ||
| public void LabelShouldSizeCorrectlyOnHorizontalEndLayoutOptions() | ||
| { | ||
| App.WaitForElement("EndButton"); | ||
| App.Tap("EndButton"); | ||
| VerifyScreenshot(); | ||
| } | ||
| } | ||
| } | ||
Binary file added
BIN
+22.3 KB
...s/snapshots/windows/LabelShouldSizeCorrectlyOnHorizontalCenterLayoutOptions.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
+22.2 KB
...ests/snapshots/windows/LabelShouldSizeCorrectlyOnHorizontalEndLayoutOptions.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
+22.2 KB
...ts/snapshots/windows/LabelShouldSizeCorrectlyOnHorizontalStartLayoutOptions.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
+100 KB
...Tests/snapshots/ios/LabelShouldSizeCorrectlyOnHorizontalCenterLayoutOptions.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
+88 KB
...OS.Tests/snapshots/ios/LabelShouldSizeCorrectlyOnHorizontalEndLayoutOptions.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
+88 KB
....Tests/snapshots/ios/LabelShouldSizeCorrectlyOnHorizontalStartLayoutOptions.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.
Uh oh!
There was an error while loading. Please reload this page.