-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android/iOS] Fix Rectangle Width broken #27280
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
Closed
devanathan-vaithiyanathan
wants to merge
15
commits into
dotnet:main
from
devanathan-vaithiyanathan:Fix-18628
Closed
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4b9074c
Revert "Fixed CollectionViewHandler2 null reference exception if Item…
devanathan-vaithiyanathan 92a1c94
Reapply "Fixed CollectionViewHandler2 null reference exception if Ite…
devanathan-vaithiyanathan 53764a1
Merge branch 'dotnet:main' into main
devanathan-vaithiyanathan 7666e57
Merge branch 'dotnet:main' into main
devanathan-vaithiyanathan 19d79a6
Merge branch 'dotnet:main' into main
devanathan-vaithiyanathan fce9a9a
Merge branch 'dotnet:main' into main
devanathan-vaithiyanathan 37459c2
Rectangle Width issue fixed
devanathan-vaithiyanathan 1335ecd
extra space removed
devanathan-vaithiyanathan 62c8bcd
test case modified and snap added
devanathan-vaithiyanathan e742b05
mac snap added
devanathan-vaithiyanathan b561219
fix optimized
devanathan-vaithiyanathan 1b75056
Revert "fix optimized"
devanathan-vaithiyanathan df1c759
Test case modified
devanathan-vaithiyanathan 3d201e6
Android and iOS snap added
devanathan-vaithiyanathan d6bf865
mac snap removed
devanathan-vaithiyanathan 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 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
Binary file added
BIN
+24.8 KB
...ntrols/tests/TestCases.Android.Tests/snapshots/android/VerifyRectangleWidth.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,60 @@ | ||
| using Microsoft.Maui.Controls.Shapes; | ||
|
|
||
| namespace Maui.Controls.Sample.Issues | ||
| { | ||
|
|
||
| [Issue(IssueTracker.Github, 18628, "[Android/iOS] Rectangle rendering is broken")] | ||
| public class Issue18628 : ContentPage | ||
| { | ||
| public Issue18628() | ||
| { | ||
| var grid = new Grid | ||
| { | ||
| WidthRequest = 600, | ||
| HeightRequest = 250, | ||
| RowDefinitions = new RowDefinitionCollection | ||
| { | ||
| new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }, | ||
| new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }, | ||
| new RowDefinition { Height = new GridLength(1, GridUnitType.Star) } | ||
| } | ||
| }; | ||
|
|
||
| var label = new Label | ||
| { | ||
| Text = "RectangleWidth Test", | ||
| HorizontalOptions = LayoutOptions.Center, | ||
| HorizontalTextAlignment = TextAlignment.Center, | ||
| VerticalTextAlignment = TextAlignment.Start, | ||
| HeightRequest = 100, | ||
| AutomationId = "Label" | ||
| }; | ||
|
|
||
| grid.Children.Add(label); | ||
| Grid.SetRow(label, 0); | ||
|
|
||
| var rectangle = new Rectangle | ||
jsuarezruiz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| Fill = Colors.Red, | ||
| AutomationId="Rectangle", | ||
| WidthRequest = 10, | ||
| VerticalOptions = LayoutOptions.Fill | ||
| }; | ||
|
|
||
| grid.Children.Add(rectangle); | ||
| Grid.SetRow(rectangle, 1); | ||
|
|
||
| var ellipse = new Ellipse | ||
| { | ||
| Fill = Colors.Blue, | ||
| VerticalOptions = LayoutOptions.Fill, | ||
| WidthRequest = 300 | ||
| }; | ||
|
|
||
| grid.Children.Add(ellipse); | ||
| Grid.SetRow(ellipse, 2); | ||
|
|
||
| Content = grid; | ||
| } | ||
| } | ||
| } | ||
23 changes: 23 additions & 0 deletions
23
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18628.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,23 @@ | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues | ||
| { | ||
| public class Issue18628 : _IssuesUITest | ||
| { | ||
| public Issue18628(TestDevice testDevice) : base(testDevice) | ||
| { | ||
| } | ||
|
|
||
| public override string Issue => "[Android/iOS] Rectangle rendering is broken"; | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Shape)] | ||
| public void VerifyRectangleWidth() | ||
| { | ||
| App.WaitForElement("Label"); | ||
| VerifyScreenshot(); | ||
| } | ||
| } | ||
| } |
Binary file added
BIN
+29.4 KB
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/VerifyRectangleWidth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
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.
The PR is described as "modifying for Android/iOS" but this change affects all platforms, or not?
Uh oh!
There was an error while loading. Please reload this page.
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.
@MartyIX Yes, these changes affect all the platforms. Windows is working properly even when the parent constraint size is returned to the shape, as the framework itself considers the defined size for the native view and returns the proper size for the drawing area. However, Android and iOS determine the size based on this measured value. We have ensured that the UI is now consistently rendered across all platforms