Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Merge branch '5.0.0' into fix-11209
Browse files Browse the repository at this point in the history
  • Loading branch information
PureWeen committed Aug 26, 2020
2 parents 43c2d3e + 997bfa5 commit f025ac5
Show file tree
Hide file tree
Showing 71 changed files with 2,131 additions and 500 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8" ?>
<local:TestShell xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:local="using:Xamarin.Forms.Controls"
xmlns:issues="using:Xamarin.Forms.Controls.Issues"
x:Class="Xamarin.Forms.Controls.Issues.Issue10679">
<Shell.Resources>
<ResourceDictionary>

<Color x:Key="NavigationPrimary">#2196F3</Color>

<Style x:Key="BaseStyle"
TargetType="Element">
<Setter Property="Shell.BackgroundColor" Value="{StaticResource NavigationPrimary}" />
<Setter Property="Shell.ForegroundColor" Value="White" />
<Setter Property="Shell.TitleColor" Value="White" />
<Setter Property="Shell.DisabledColor" Value="#B4FFFFFF" />
<Setter Property="Shell.UnselectedColor" Value="#95FFFFFF" />
<Setter Property="Shell.TabBarBackgroundColor" Value="{StaticResource NavigationPrimary}" />
<Setter Property="Shell.TabBarForegroundColor" Value="White" />
<Setter Property="Shell.TabBarUnselectedColor" Value="#95FFFFFF" />
<Setter Property="Shell.TabBarTitleColor" Value="White" />
</Style>

<Style BasedOn="{StaticResource BaseStyle}"
TargetType="TabBar" />

</ResourceDictionary>
</Shell.Resources>
<ShellContent ContentTemplate="{DataTemplate issues:FirstIssue10679Page}" />
</local:TestShell>
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
using System.Collections.Generic;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

#if UITEST
using Xamarin.Forms.Core.UITests;
using Xamarin.UITest;
using NUnit.Framework;
#endif

namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 10679, "SwipeView crash with NullReferenceException",
PlatformAffected.Android)]
public partial class Issue10679 : TestShell
{
public Issue10679()
{
#if APP
Device.SetFlags(new List<string>(Device.Flags ?? new List<string>()) { "SwipeView_Experimental" });
InitializeComponent();
#endif
}

protected override void Init()
{

}
}

[Preserve(AllMembers = true)]
public class FirstIssue10679Page : ContentPage
{
public FirstIssue10679Page()
{
Title = "Issue 10679";

var layout = new Grid();

var button = new Button
{
VerticalOptions = LayoutOptions.Center,
Text = "Go to Next Page"
};

layout.Children.Add(button);

Content = layout;

button.Clicked += async (sender, args) =>
{
await Shell.Current.Navigation.PushAsync(new SecondIssue10679Page()).ConfigureAwait(false);
};
}
}

[Preserve(AllMembers = true)]
public class SecondIssue10679Page : ContentPage
{
public SecondIssue10679Page()
{
var layout = new Grid();

var swipeView = new SwipeView();

var leftItem = new SwipeItem
{
BackgroundColor = Color.Red
};

var leftItems = new SwipeItems
{
Mode = SwipeMode.Execute,
SwipeBehaviorOnInvoked = SwipeBehaviorOnInvoked.Close
};

leftItems.Add(leftItem);

var rightItem = new SwipeItem
{
BackgroundColor = Color.Green
};

var rightItems = new SwipeItems
{
Mode = SwipeMode.Execute,
SwipeBehaviorOnInvoked = SwipeBehaviorOnInvoked.Close
};

rightItems.Add(rightItem);

var content = new Grid
{
BackgroundColor = Color.White
};

var contentLabel = new Label
{
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center,
Text = "Swipe Left or Right"
};

content.Children.Add(contentLabel);

swipeView.Content = content;
swipeView.LeftItems = leftItems;
swipeView.RightItems = rightItems;

layout.Children.Add(swipeView);

Content = layout;

leftItem.Invoked += async (sender, args) =>
{
Shell.Current.Navigation.InsertPageBefore(new ThirdIssue10679Page(), this);
_ = await Shell.Current.Navigation.PopAsync(false);
};

rightItem.Invoked += async (sender, args) =>
{
Shell.Current.Navigation.InsertPageBefore(new ThirdIssue10679Page(), this);
_ = await Shell.Current.Navigation.PopAsync(false);
};
}
}

[Preserve(AllMembers = true)]
public class ThirdIssue10679Page : ContentPage
{
public ThirdIssue10679Page()
{
var layout = new StackLayout();

var infoLabel = new Label
{
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center,
Text = "Without NullReferenceException, the test has passed."
};

layout.Children.Add(infoLabel);

Content = layout;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8" ?>
<controls:TestContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:controls="clr-namespace:Xamarin.Forms.Controls"
x:Class="Xamarin.Forms.Controls.Issues.Issue11190"
Title="Issue 11190">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label
Padding="12"
BackgroundColor="Black"
TextColor="White"
Text="If the Shape is rendered without problems or exceptions, the test has passed."/>
<Grid
Grid.Row="1"
HorizontalOptions="Start"
VerticalOptions="Start"
HeightRequest="200"
WidthRequest="200">
<Path
Stroke="Black"
HeightRequest="200"
WidthRequest="200">
<Path.Data>
<PathGeometry>
<PathGeometry.Figures>
<PathFigureCollection>
<PathFigure
StartPoint="0,0">
<PathFigure.Segments>
<PathSegmentCollection>
<ArcSegment
Size="100,100"
RotationAngle="45"
IsLargeArc="True"
SweepDirection="CounterClockwise"
Point="100,100" />
</PathSegmentCollection>
</PathFigure.Segments>
</PathFigure>
</PathFigureCollection>
</PathGeometry.Figures>
</PathGeometry>
</Path.Data>
</Path>
</Grid>
</Grid>
</controls:TestContentPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
using System.Collections.Generic;

#if UITEST && __ANDROID__
using Xamarin.UITest;
using Xamarin.UITest.Queries;
using NUnit.Framework;
using Xamarin.Forms.Core.UITests;
using System.Linq;
#endif

namespace Xamarin.Forms.Controls.Issues
{
#if UITEST && __ANDROID__
[Category(UITestCategories.Shape)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 11190, "[Bug] Shapes: ArcSegment throwing on iOS, doing nothing on Android", PlatformAffected.Android | PlatformAffected.iOS)]
public partial class Issue11190 : TestContentPage
{

public Issue11190()
{
#if APP
Device.SetFlags(new List<string> { ExperimentalFlags.ShapesExperimental });
InitializeComponent();
#endif
}


protected override void Init()
{

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ void OnSwipeViewSwipeEnded(object sender, SwipeEndedEventArgs e)
}
#endif

#if UITEST
#if UITEST && __ANDROID__

[Test]
[Category(UITestCategories.SwipeView)]
public void SwipeWithChildGestureRecognizer()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8" ?>
<controls:TestContentPage
xmlns:controls="clr-namespace:Xamarin.Forms.Controls"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Xamarin.Forms.Controls.Issues.Issue11653"
Title="Issue 11653">
<ContentPage.Content>
<StackLayout>
<Label
Padding="12"
BackgroundColor="Black"
TextColor="White">
<Label.FormattedText>
<FormattedString>
<Span
Text="Without exceptions, the test has passed."/>
<Span
Text="NOTE: Nothing will render."/>
</FormattedString>
</Label.FormattedText>
</Label>
<Path Aspect="Uniform">
<Path.Data>
<PathGeometry>
<PathGeometry.Figures>
<PathFigureCollection>
<PathFigure
IsClosed="True"
StartPoint="10,100">
<PathFigure.Segments>
<PathSegmentCollection>
<PolyBezierSegment
Points="100, 100" />
</PathSegmentCollection>
</PathFigure.Segments>
</PathFigure>
</PathFigureCollection>
</PathGeometry.Figures>
</PathGeometry>
</Path.Data>
</Path>
</StackLayout>
</ContentPage.Content>
</controls:TestContentPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Xamarin.Forms.Internals;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Shapes;
using System.Collections.Generic;

#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
using Xamarin.Forms.Core.UITests;
#endif

namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.Shape)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 11653,
"[Bug] Polygon.Points doesn't respond to CollectionChanged events",
PlatformAffected.All)]
public partial class Issue11653 : TestContentPage
{
public Issue11653()
{
#if APP
Device.SetFlags(new List<string> { ExperimentalFlags.BrushExperimental, ExperimentalFlags.ShapesExperimental });
InitializeComponent();
#endif
}

protected override void Init()
{

}
}
}
Loading

0 comments on commit f025ac5

Please sign in to comment.