-
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
[Android] Fixed box view properties #21322
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b052621
Added a Ui Test (#19926)
kubaflo 63f9e65
[Android] box view properties fix (#19926)
kubaflo 2f84a7f
Revert "[Android] box view properties fix (#19926)"
kubaflo f40b8b9
Update BoxView (#19926)
kubaflo 34616c2
Update BoxView.cs
kubaflo d3f6d8f
Added snapshot
jsuarezruiz 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
36 changes: 36 additions & 0 deletions
36
src/Controls/samples/Controls.Sample.UITests/Issues/Issue19926.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,36 @@ | ||
<?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.Issue19926" | ||
Title="Issue19926"> | ||
|
||
<ContentPage.Resources> | ||
<Style TargetType="BoxView"> | ||
<Setter Property="WidthRequest" Value="100"/> | ||
<Setter Property="HeightRequest" Value="100"/> | ||
<Setter Property="Background"> | ||
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> | ||
<GradientStop Offset="0.4" Color="Red" /> | ||
<GradientStop Offset="1" Color="Blue" /> | ||
</LinearGradientBrush> | ||
</Setter> | ||
</Style> | ||
</ContentPage.Resources> | ||
|
||
<StackLayout Spacing="20"> | ||
<StackLayout> | ||
<Label HorizontalTextAlignment="Center" Text="Translation X"/> | ||
<BoxView TranslationX="30" AutomationId="boxView"/> | ||
</StackLayout> | ||
|
||
<StackLayout> | ||
<Label HorizontalTextAlignment="Center" Text="Opacity"/> | ||
<BoxView Opacity="0.2"/> | ||
</StackLayout> | ||
|
||
<StackLayout> | ||
<Label HorizontalTextAlignment="Center" Text="Scale X"/> | ||
<BoxView ScaleX="1.5"/> | ||
</StackLayout> | ||
</StackLayout> | ||
</ContentPage> |
15 changes: 15 additions & 0 deletions
15
src/Controls/samples/Controls.Sample.UITests/Issues/Issue19926.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,15 @@ | ||
using Microsoft.Maui.Controls; | ||
using Microsoft.Maui.Controls.Xaml; | ||
|
||
namespace Maui.Controls.Sample.Issues; | ||
|
||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
[Issue(IssueTracker.Github, 19926, "[Android] Opacity bug on BoxView.Background", PlatformAffected.Android)] | ||
|
||
public partial class Issue19926 : ContentPage | ||
{ | ||
public Issue19926() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
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
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,23 @@ | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.AppiumTests.Issues; | ||
|
||
public class Issue19926 : _IssuesUITest | ||
{ | ||
public override string Issue => "[Android] Opacity bug on BoxView.Background"; | ||
|
||
public Issue19926(TestDevice device) | ||
: base(device) | ||
{ } | ||
|
||
[Test] | ||
public void PropertiesShouldBeCorrectlyApplied() | ||
{ | ||
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS, TestDevice.Mac, TestDevice.Windows }); | ||
_ = App.WaitForElement("boxView"); | ||
|
||
VerifyScreenshot(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added pending snapshot. |
||
} | ||
} |
Binary file added
BIN
+30.4 KB
...Controls/tests/UITests/snapshots/android/PropertiesShouldBeCorrectlyApplied.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.
I don't understand how this fixes it ,
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.
@rmarinho I've noticed that the box view is rendered twice. It is easy to observe when setting the translationY property to 200. This is the outcome:
With this
((IView)this).Background
part removed from the code the shapeViewHandler doesn't update the background and therefore does not draw that top right boxViewmaui/src/Core/src/Handlers/ShapeView/ShapeViewHandler.Android.cs
Line 18 in 402fdf7