-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fixed FlowDirection property not working on Drawable control and GraphicsView #34557
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
4 commits
Select commit
Hold shift + click to select a range
6846243
Fixed FlowDirection property not working on Drawable control and Grap…
Dhivya-SF4094 b42b80d
Addressed review concern
Dhivya-SF4094 8ce20a2
Add snapshots for iOS 26 and resaved images for failed case
Dhivya-SF4094 9a7da44
Updated test sample and added resaved snapshot for mac
Dhivya-SF4094 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
+4.76 KB
(110%)
...Cases.Android.Tests/snapshots/android/BoxView_CornerRadiusWithFlowDirection.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
+59.6 KB
...ontrols/tests/TestCases.Android.Tests/snapshots/android/BoxView_LTR_Initial.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
+59.6 KB
...ols/tests/TestCases.Android.Tests/snapshots/android/BoxView_RTL_AfterButton.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
+59.6 KB
...ls/tests/TestCases.Android.Tests/snapshots/android/GraphicsView_LTR_Initial.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
+56.4 KB
...ests/TestCases.Android.Tests/snapshots/android/GraphicsView_RTL_AfterButton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
107 changes: 107 additions & 0 deletions
107
src/Controls/tests/TestCases.HostApp/Issues/Issue34402.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,107 @@ | ||
| using Microsoft.Maui.Controls; | ||
| using Microsoft.Maui.Graphics; | ||
| using Microsoft.Maui; | ||
|
|
||
| namespace Maui.Controls.Sample.Issues | ||
| { | ||
| [Issue(IssueTracker.Github, 34402, "FlowDirection property not working on BoxView Control", PlatformAffected.All)] | ||
| public class Issue34402 : ContentPage | ||
| { | ||
| public Issue34402() | ||
| { | ||
| var boxViewLabel = new Label | ||
| { | ||
| Text = "BoxView with different corner radius values on each corner", | ||
| HorizontalOptions = LayoutOptions.Center, | ||
| AutomationId = "Issue34402Label" | ||
| }; | ||
|
|
||
| var boxView = new BoxView | ||
| { | ||
| CornerRadius = new CornerRadius(30, 60, 10, 20), | ||
| Color = Colors.CornflowerBlue, | ||
| WidthRequest = 200, | ||
| HeightRequest = 200, | ||
| FlowDirection = FlowDirection.LeftToRight | ||
| }; | ||
|
|
||
| var graphicsViewLabel = new Label | ||
| { | ||
| Text = "GraphicsView with a triangle drawable", | ||
| HorizontalOptions = LayoutOptions.Center, | ||
| AutomationId = "Issue34402GraphicsViewLabel" | ||
| }; | ||
|
|
||
| var graphicsView = new GraphicsView | ||
| { | ||
| Drawable = new TriangleDrawable(), | ||
| WidthRequest = 200, | ||
| HeightRequest = 100, | ||
| FlowDirection = FlowDirection.LeftToRight | ||
| }; | ||
|
|
||
| var boxViewRtlButton = new Button | ||
| { | ||
| Text = "Toggle BoxView RTL", | ||
| AutomationId = "BoxViewRtlButton" | ||
| }; | ||
|
|
||
| bool boxViewIsRtl = false; | ||
| boxViewRtlButton.Clicked += (s, e) => | ||
| { | ||
| boxViewIsRtl = !boxViewIsRtl; | ||
| boxView.FlowDirection = boxViewIsRtl ? FlowDirection.RightToLeft : FlowDirection.LeftToRight; | ||
| }; | ||
|
|
||
| var graphicsViewRtlButton = new Button | ||
| { | ||
| Text = "Toggle GraphicsView RTL", | ||
| AutomationId = "GraphicsViewRtlButton" | ||
| }; | ||
|
|
||
| bool graphicsViewIsRtl = false; | ||
| graphicsViewRtlButton.Clicked += (s, e) => | ||
| { | ||
| graphicsViewIsRtl = !graphicsViewIsRtl; | ||
| graphicsView.FlowDirection = graphicsViewIsRtl ? FlowDirection.RightToLeft : FlowDirection.LeftToRight; | ||
| }; | ||
|
|
||
| Content = new VerticalStackLayout | ||
| { | ||
| Spacing = 20, | ||
| Children = | ||
| { | ||
| boxViewLabel, | ||
| boxView, | ||
| boxViewRtlButton, | ||
| graphicsViewLabel, | ||
| graphicsView, | ||
| graphicsViewRtlButton | ||
| } | ||
| }; | ||
| } | ||
|
|
||
| class TriangleDrawable : IDrawable | ||
| { | ||
| public void Draw(ICanvas canvas, RectF dirtyRect) | ||
| { | ||
| canvas.StrokeColor = Colors.Black; | ||
| canvas.StrokeSize = 2; | ||
|
|
||
| // Right angle triangle fitted to the view bounds | ||
| float left = dirtyRect.Left + 10; | ||
| float right = dirtyRect.Right - 10; | ||
| float top = dirtyRect.Top + 10; | ||
| float bottom = dirtyRect.Bottom - 10; | ||
|
|
||
| PathF path = new PathF(); | ||
| path.MoveTo(left, bottom); // bottom-left | ||
| path.LineTo(right, bottom); // bottom-right | ||
| path.LineTo(left, top); // top-left | ||
| path.Close(); | ||
|
|
||
| canvas.DrawPath(path); | ||
| } | ||
| } | ||
| } | ||
| } | ||
Binary file modified
BIN
+139 Bytes
(100%)
...sts/TestCases.Mac.Tests/snapshots/mac/BoxView_CornerRadiusWithFlowDirection.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
+25.9 KB
src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/BoxView_LTR_Initial.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
+26 KB
src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/GraphicsView_LTR_Initial.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
+25.4 KB
...ntrols/tests/TestCases.Mac.Tests/snapshots/mac/GraphicsView_RTL_AfterButton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions
35
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34402.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,35 @@ | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues | ||
| { | ||
| public class Issue34402 : _IssuesUITest | ||
| { | ||
| public Issue34402(TestDevice device) : base(device) { } | ||
|
|
||
| public override string Issue => "FlowDirection property not working on BoxView Control"; | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.BoxView)] | ||
| public void BoxViewFlowDirectionShouldMirrorOnRTL() | ||
| { | ||
| App.WaitForElement("Issue34402Label"); | ||
| VerifyScreenshot("BoxView_LTR_Initial"); | ||
|
|
||
| App.Tap("BoxViewRtlButton"); | ||
| VerifyScreenshot("BoxView_RTL_AfterButton"); | ||
| } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.GraphicsView)] | ||
| public void GraphicsViewFlowDirectionShouldMirrorOnRTL() | ||
| { | ||
| App.WaitForElement("Issue34402GraphicsViewLabel"); | ||
| VerifyScreenshot("GraphicsView_LTR_Initial"); | ||
|
|
||
| App.Tap("GraphicsViewRtlButton"); | ||
| VerifyScreenshot("GraphicsView_RTL_AfterButton"); | ||
| } | ||
|
Dhivya-SF4094 marked this conversation as resolved.
|
||
| } | ||
| } | ||
Binary file modified
BIN
+1.15 KB
(110%)
...stCases.WinUI.Tests/snapshots/windows/BoxView_CornerRadiusWithFlowDirection.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
-12.5 KB
(91%)
.../TestCases.iOS.Tests/snapshots/ios-26/BoxView_CornerRadiusWithFlowDirection.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
+65.1 KB
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios-26/BoxView_LTR_Initial.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
+65.1 KB
...Controls/tests/TestCases.iOS.Tests/snapshots/ios-26/BoxView_RTL_AfterButton.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
+65.1 KB
...ontrols/tests/TestCases.iOS.Tests/snapshots/ios-26/GraphicsView_LTR_Initial.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
+64.4 KB
...ols/tests/TestCases.iOS.Tests/snapshots/ios-26/GraphicsView_RTL_AfterButton.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
+64.5 KB
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/BoxView_LTR_Initial.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
+64.5 KB
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/BoxView_RTL_AfterButton.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
+64.5 KB
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/GraphicsView_LTR_Initial.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
+63.8 KB
...ntrols/tests/TestCases.iOS.Tests/snapshots/ios/GraphicsView_RTL_AfterButton.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
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
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.