-
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.
[Android] Fixed box view properties (#21322)
* Added a Ui Test (#19926) * [Android] box view properties fix (#19926) * Revert "[Android] box view properties fix (#19926)" This reverts commit 1995547. * Update BoxView (#19926) * Update BoxView.cs * Added snapshot --------- Co-authored-by: Javier Suárez <[email protected]>
- Loading branch information
1 parent
d9226a5
commit 70e8800
Showing
5 changed files
with
76 additions
and
1 deletion.
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(); | ||
} | ||
} |
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.