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

Commit 16b290a

Browse files
authored
Fixed build error (#11983)
1 parent aa71924 commit 16b290a

File tree

7 files changed

+444
-0
lines changed

7 files changed

+444
-0
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<local:TestContentPage
3+
xmlns="http://xamarin.com/schemas/2014/forms"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
5+
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
6+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7+
mc:Ignorable="d"
8+
xmlns:local="using:Xamarin.Forms.Controls"
9+
x:Class="Xamarin.Forms.Controls.Issues.Issue11573"
10+
Title="Issue 11573">
11+
<ScrollView>
12+
<StackLayout>
13+
<Label
14+
Padding="12"
15+
BackgroundColor="Black"
16+
TextColor="White"
17+
Text="If the RadialGradientBrush Radius is the same in all cases, the test has passed."/>
18+
<StackLayout
19+
Padding="12">
20+
<Label
21+
Text="RadialGradientBrush (Upper left)"
22+
FontAttributes="Bold" />
23+
<Frame
24+
Margin="0,12,0,0"
25+
BorderColor="LightGray"
26+
HasShadow="True"
27+
CornerRadius="12"
28+
HeightRequest="60"
29+
WidthRequest="120">
30+
<Frame.Background>
31+
<RadialGradientBrush Center="0.1,0.1"
32+
Radius="0.5">
33+
<RadialGradientBrush.GradientStops>
34+
<GradientStop Color="Red"
35+
Offset="0.1" />
36+
<GradientStop Color="DarkBlue"
37+
Offset="1.0" />
38+
</RadialGradientBrush.GradientStops>
39+
</RadialGradientBrush>
40+
</Frame.Background>
41+
</Frame>
42+
<Label
43+
Margin="0,12,0,0"
44+
Text="RadialGradientBrush (Center)"
45+
FontAttributes="Bold" />
46+
<Frame
47+
Margin="0,12,0,0"
48+
BorderColor="LightGray"
49+
HasShadow="True"
50+
CornerRadius="12"
51+
HeightRequest="60"
52+
WidthRequest="120">
53+
<Frame.Background>
54+
<RadialGradientBrush Center="0.5,0.5"
55+
Radius="0.5">
56+
<RadialGradientBrush.GradientStops>
57+
<GradientStop Color="Red"
58+
Offset="0.1" />
59+
<GradientStop Color="DarkBlue"
60+
Offset="1.0" />
61+
</RadialGradientBrush.GradientStops>
62+
</RadialGradientBrush>
63+
</Frame.Background>
64+
</Frame>
65+
<Label Margin="0,12,0,0"
66+
Text="RadialGradientBrush (Lower right)"
67+
FontAttributes="Bold" />
68+
<Frame
69+
Margin="0,12,0,0"
70+
BorderColor="LightGray"
71+
HasShadow="True"
72+
CornerRadius="12"
73+
HeightRequest="60"
74+
WidthRequest="120">
75+
<Frame.Background>
76+
<RadialGradientBrush Center="0.9,0.9"
77+
Radius="0.5">
78+
<RadialGradientBrush.GradientStops>
79+
<GradientStop Color="Red"
80+
Offset="0.1" />
81+
<GradientStop Color="DarkBlue"
82+
Offset="1.0" />
83+
</RadialGradientBrush.GradientStops>
84+
</RadialGradientBrush>
85+
</Frame.Background>
86+
</Frame>
87+
</StackLayout>
88+
</StackLayout>
89+
</ScrollView>
90+
</local:TestContentPage>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Collections.Generic;
2+
using Xamarin.Forms.CustomAttributes;
3+
using Xamarin.Forms.Internals;
4+
using Xamarin.Forms.Xaml;
5+
6+
#if UITEST
7+
using Xamarin.Forms.Core.UITests;
8+
using Xamarin.UITest;
9+
using NUnit.Framework;
10+
#endif
11+
12+
namespace Xamarin.Forms.Controls.Issues
13+
{
14+
[Preserve(AllMembers = true)]
15+
[Issue(IssueTracker.Github, 11573, "[Bug][Brushes] RadialGradient size on iOS",
16+
PlatformAffected.iOS)]
17+
#if UITEST
18+
[NUnit.Framework.Category(UITestCategories.Brush)]
19+
#endif
20+
public partial class Issue11573 : TestContentPage
21+
{
22+
public Issue11573()
23+
{
24+
#if APP
25+
Device.SetFlags(new List<string> { ExperimentalFlags.BrushExperimental });
26+
27+
InitializeComponent();
28+
#endif
29+
}
30+
31+
protected override void Init()
32+
{
33+
34+
}
35+
}
36+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<controls:TestContentPage
3+
xmlns:controls="clr-namespace:Xamarin.Forms.Controls"
4+
xmlns="http://xamarin.com/schemas/2014/forms"
5+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
6+
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
7+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
mc:Ignorable="d"
9+
x:Class="Xamarin.Forms.Controls.Issues.Issue11737"
10+
Title="Issue 11737">
11+
<StackLayout>
12+
<Label
13+
Padding="12"
14+
BackgroundColor="Black"
15+
TextColor="White"
16+
Text="Swipe any SwipeItem and try to increment the counter. If you can increment the counter without closing the SwipeView, the test has passed."/>
17+
<Grid>
18+
<CollectionView x:Name="collectionView" ItemsSource="{Binding Items}" VerticalOptions="Center">
19+
<CollectionView.ItemTemplate>
20+
<DataTemplate>
21+
<SwipeView BackgroundColor="DarkGray">
22+
<SwipeView.LeftItems>
23+
<SwipeItems Mode="Reveal" SwipeBehaviorOnInvoked="RemainOpen">
24+
<SwipeItemView>
25+
<Grid Margin="6, 0">
26+
<Button BackgroundColor="Yellow" WidthRequest="50" TextColor="Black" Grid.Column="1" Text="+" Command="{Binding Source={x:Reference collectionView}, Path=BindingContext.IncrementCommand}" CommandParameter="{Binding}" />
27+
<Button BackgroundColor="Yellow" WidthRequest="50" TextColor="Black" Grid.Column="0" Text="-" Command="{Binding Source={x:Reference collectionView}, Path=BindingContext.DecrementCommand}" CommandParameter="{Binding}" />
28+
</Grid>
29+
</SwipeItemView>
30+
</SwipeItems>
31+
</SwipeView.LeftItems>
32+
<Grid BackgroundColor="LightGray" Margin="6" Padding="6">
33+
<Grid.RowDefinitions>
34+
<RowDefinition Height="50" />
35+
</Grid.RowDefinitions>
36+
<Grid.ColumnDefinitions>
37+
<ColumnDefinition Width="*" />
38+
<ColumnDefinition Width="*" />
39+
</Grid.ColumnDefinitions>
40+
<Label Text="{Binding Title}" Grid.Column="0" FontSize="Large" VerticalOptions="Center" />
41+
<Label Text="{Binding Count}" Grid.Column="1" FontSize="Large" VerticalOptions="Center" />
42+
</Grid>
43+
</SwipeView>
44+
</DataTemplate>
45+
</CollectionView.ItemTemplate>
46+
</CollectionView>
47+
</Grid>
48+
</StackLayout>
49+
</controls:TestContentPage>
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
using Xamarin.Forms.CustomAttributes;
2+
using Xamarin.Forms.Internals;
3+
using Xamarin.Forms.Xaml;
4+
using System.Collections.Generic;
5+
using System.ComponentModel;
6+
using System.Runtime.CompilerServices;
7+
using System.Collections.ObjectModel;
8+
using System.Windows.Input;
9+
10+
#if UITEST
11+
using Xamarin.UITest;
12+
using Xamarin.UITest.Queries;
13+
using NUnit.Framework;
14+
using Xamarin.Forms.Core.UITests;
15+
#endif
16+
17+
namespace Xamarin.Forms.Controls.Issues
18+
{
19+
#if UITEST
20+
[NUnit.Framework.Category(UITestCategories.Brush)]
21+
#endif
22+
#if APP
23+
[XamlCompilation(XamlCompilationOptions.Compile)]
24+
#endif
25+
[Preserve(AllMembers = true)]
26+
[Issue(IssueTracker.Github, 11737, "[Bug] SwipeView Closes After Command Executes Despite SwipeBehaviorOnInvoked=RemainOpen (iOS)", PlatformAffected.iOS)]
27+
public partial class Issue11737 : TestContentPage
28+
{
29+
public Issue11737()
30+
{
31+
#if APP
32+
Title = "Issue 11737";
33+
Device.SetFlags(new List<string> { ExperimentalFlags.SwipeViewExperimental });
34+
InitializeComponent();
35+
BindingContext = new Issue11737ViewModel();
36+
#endif
37+
}
38+
39+
protected override void Init()
40+
{
41+
42+
}
43+
}
44+
45+
[Preserve(AllMembers = true)]
46+
class Issue11737Model : BindableObject
47+
{
48+
int _count = 1;
49+
50+
public string Title { get; set; }
51+
52+
public int Count
53+
{
54+
get { return _count; }
55+
set
56+
{
57+
_count = value;
58+
OnPropertyChanged();
59+
}
60+
}
61+
}
62+
63+
[Preserve(AllMembers = true)]
64+
class Issue11737ViewModel : BindableObject
65+
{
66+
public ObservableCollection<Issue11737Model> Items { get; private set; } = new ObservableCollection<Issue11737Model>();
67+
68+
public ICommand IncrementCommand => new Command<Issue11737Model>(Increment);
69+
public ICommand DecrementCommand => new Command<Issue11737Model>(Decrement);
70+
71+
72+
public Issue11737ViewModel()
73+
{
74+
Items = new ObservableCollection<Issue11737Model>
75+
{
76+
new Issue11737Model(){ Title = "item 1" , Count=2 },
77+
new Issue11737Model(){ Title = "item 2" , Count=5 },
78+
new Issue11737Model(){ Title = "item 3" , Count=3 },
79+
};
80+
}
81+
82+
public void Increment(Issue11737Model item)
83+
{
84+
item.Count++;
85+
}
86+
public void Decrement(Issue11737Model item)
87+
{
88+
item.Count--;
89+
}
90+
}
91+
}
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<controls:TestContentPage
3+
xmlns:controls="clr-namespace:Xamarin.Forms.Controls"
4+
xmlns="http://xamarin.com/schemas/2014/forms"
5+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
6+
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
7+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
mc:Ignorable="d"
9+
x:Class="Xamarin.Forms.Controls.Issues.Issue11764"
10+
x:Name="Issue11764Page"
11+
Title="Issue 11764">
12+
<StackLayout
13+
Padding="0">
14+
<Label
15+
Padding="12"
16+
BackgroundColor="Black"
17+
TextColor="White"
18+
Text="If you don't see a red line between each item when swipe, the test has passed."/>
19+
<Grid>
20+
<CollectionView
21+
x:Name="DataListView"
22+
ItemsSource="{Binding Data}">
23+
<CollectionView.ItemTemplate>
24+
<DataTemplate x:DataType="x:String">
25+
<SwipeView
26+
BackgroundColor="Red">
27+
<SwipeView.GestureRecognizers>
28+
<TapGestureRecognizer
29+
Command="{Binding BindingContext.TapCommand, Source={x:Reference Issue11764Page}}"
30+
CommandParameter="{Binding}" />
31+
</SwipeView.GestureRecognizers>
32+
<SwipeView.RightItems>
33+
<SwipeItems>
34+
<SwipeItemView
35+
Command="{Binding BindingContext.DeleteCommand, Source={x:Reference Issue11764Page}}"
36+
CommandParameter="{Binding}">
37+
<Grid
38+
BackgroundColor="LightSlateGray">
39+
<Frame
40+
BackgroundColor="#de3f45"
41+
BorderColor="White"
42+
Margin="8"
43+
Padding="10"
44+
CornerRadius="5">
45+
<StackLayout
46+
Orientation="Vertical"
47+
VerticalOptions="Center"
48+
HorizontalOptions="Center">
49+
<Label
50+
Text="Delete"
51+
FontSize="Medium"
52+
FontAttributes="Bold"
53+
LineBreakMode="NoWrap"
54+
WidthRequest="64"
55+
HorizontalTextAlignment="Center" />
56+
</StackLayout>
57+
</Frame>
58+
</Grid>
59+
</SwipeItemView>
60+
<SwipeItemView
61+
Command="{Binding BindingContext.PinCommand, Source={x:Reference Issue11764Page}}"
62+
CommandParameter="{Binding}">
63+
<Grid
64+
BackgroundColor="LightSlateGray">
65+
<Frame
66+
BackgroundColor="#ff8932"
67+
BorderColor="White"
68+
Margin="8"
69+
Padding="10"
70+
CornerRadius="5">
71+
<StackLayout
72+
Orientation="Vertical"
73+
VerticalOptions="Center"
74+
HorizontalOptions="Center">
75+
<Label
76+
Text="Pin"
77+
FontSize="Medium"
78+
FontAttributes="Bold"
79+
LineBreakMode="NoWrap"
80+
WidthRequest="64"
81+
HorizontalTextAlignment="Center" />
82+
</StackLayout>
83+
</Frame>
84+
</Grid>
85+
</SwipeItemView>
86+
</SwipeItems>
87+
</SwipeView.RightItems>
88+
<Grid
89+
BackgroundColor="LightSlateGray">
90+
<Frame
91+
BackgroundColor="DarkSlateGray"
92+
BorderColor="White"
93+
Margin="8"
94+
Padding="25"
95+
CornerRadius="5">
96+
<Label
97+
Text="{Binding}"
98+
TextColor="White"
99+
FontAttributes="Bold"
100+
FontSize="Medium"
101+
HorizontalTextAlignment="Center" />
102+
</Frame>
103+
</Grid>
104+
</SwipeView>
105+
</DataTemplate>
106+
</CollectionView.ItemTemplate>
107+
</CollectionView>
108+
</Grid>
109+
</StackLayout>
110+
</controls:TestContentPage>

0 commit comments

Comments
 (0)