This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
1,970 additions
and
809 deletions.
There are no files selected for viewing
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
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
93 changes: 93 additions & 0 deletions
93
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue12193.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,93 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
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 | ||
{ | ||
#if UITEST | ||
[Category(UITestCategories.CarouselView)] | ||
#endif | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 12193, "[Bug] CarouselView content disappears after 2 rotations if TextType=Html is used", | ||
PlatformAffected.iOS)] | ||
public class Issue12193 : TestContentPage | ||
{ | ||
public const string HTML = "HTML"; | ||
|
||
protected override void Init() | ||
{ | ||
#if APP | ||
Title = "CarouselView HTML Label"; | ||
|
||
var instructions = new Label { Text = $"Rotate the device, then rotate it back 3 times. If the label \"{HTML}\" disappears, this test has failed." }; | ||
|
||
var source = new List<string>(); | ||
for (int n = 0; n < 10; n++) | ||
{ | ||
source.Add($"Item: {n}"); | ||
} | ||
|
||
var template = new DataTemplate(() => | ||
{ | ||
var label = new Label | ||
{ | ||
TextType = TextType.Html, | ||
Text = $"<p style='background-color:red;'>{HTML}</p>", | ||
AutomationId = HTML | ||
}; | ||
return label; | ||
}); | ||
|
||
var cv = new CarouselView() | ||
{ | ||
ItemsSource = source, | ||
ItemTemplate = template, | ||
Loop = false | ||
}; | ||
|
||
var layout = new StackLayout(); | ||
|
||
layout.Children.Add(instructions); | ||
layout.Children.Add(cv); | ||
|
||
Content = layout; | ||
#endif | ||
} | ||
|
||
|
||
#if UITEST | ||
[Test] | ||
public async Task RotatingCarouselViewHTMLShouldNotDisappear() | ||
{ | ||
int delay = 3000; | ||
|
||
RunningApp.SetOrientationPortrait(); | ||
await Task.Delay(delay); | ||
|
||
RunningApp.SetOrientationLandscape(); | ||
await Task.Delay(delay); | ||
|
||
RunningApp.SetOrientationPortrait(); | ||
await Task.Delay(delay); | ||
|
||
RunningApp.SetOrientationLandscape(); | ||
await Task.Delay(delay); | ||
|
||
RunningApp.SetOrientationPortrait(); | ||
await Task.Delay(delay); | ||
|
||
RunningApp.WaitForElement(HTML); | ||
} | ||
#endif | ||
} | ||
} |
87 changes: 87 additions & 0 deletions
87
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue12374.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,87 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<controls:TestContentPage | ||
xmlns="http://xamarin.com/schemas/2014/forms" | ||
xmlns:controls="clr-namespace:Xamarin.Forms.Controls" | ||
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" | ||
x:Class="Xamarin.Forms.Controls.Issues.Issue12374" | ||
Title="Issue 12374"> | ||
<Grid RowDefinitions="Auto,Auto,*"> | ||
<Label | ||
Grid.Row="0" | ||
AutomationId = "TestReady" | ||
Padding="12" | ||
BackgroundColor="Black" | ||
TextColor="White" | ||
Text="Tap each item to remove them and view the EmptyView. Then, tap the AddItems button. Without crash, the test has passed."/> | ||
<StackLayout | ||
Grid.Row="1" | ||
Orientation="Horizontal" | ||
HorizontalOptions="Center" | ||
Margin="20"> | ||
<Button | ||
AutomationId="AddItems" | ||
Text="Add Items" | ||
Clicked="AddItemsButton_Clicked" /> | ||
<Button | ||
AutomationId="RemoveItems" | ||
Text="Remove Items" | ||
Clicked="RemoveItemsButton_Clicked" /> | ||
</StackLayout> | ||
<RefreshView | ||
Grid.Row="2" | ||
x:Name="MainRefreshView" | ||
IsRefreshing="{Binding IsRefreshing}" | ||
Command="{Binding RefreshCommand}"> | ||
<CollectionView | ||
Grid.Row="1" | ||
ItemsSource="{Binding Items}" | ||
SelectionMode="Single" | ||
SelectionChanged="CollectionView_SelectionChanged"> | ||
<CollectionView.EmptyView> | ||
<Grid> | ||
<Label | ||
Text="Empty View" | ||
HorizontalOptions="Center" | ||
VerticalOptions="Center" /> | ||
</Grid> | ||
</CollectionView.EmptyView> | ||
<!-- | ||
<CollectionView.EmptyViewTemplate> | ||
<DataTemplate> | ||
<Grid> | ||
<Label Text="Empty Template View" HorizontalOptions="Center" VerticalOptions="Center" /> | ||
</Grid> | ||
</DataTemplate> | ||
</CollectionView.EmptyViewTemplate> | ||
--> | ||
<CollectionView.ItemTemplate> | ||
<DataTemplate> | ||
<!-- | ||
<SwipeView> | ||
<SwipeView.RightItems> | ||
<SwipeItems> | ||
<SwipeItem Text="Delete" BackgroundColor="Red" Invoked="Item_SwipeInvoked" /> | ||
</SwipeItems> | ||
</SwipeView.RightItems> | ||
<Grid HeightRequest="40" Padding="10" BackgroundColor="{Binding Color}"> | ||
<Label Text="{Binding Name}" VerticalOptions="Center" /> | ||
</Grid> | ||
</SwipeView> | ||
--> | ||
<Grid | ||
HeightRequest="40" | ||
Padding="10" | ||
BackgroundColor="{Binding Color}"> | ||
<Label | ||
Text="{Binding Name}" | ||
VerticalOptions="Center" /> | ||
</Grid> | ||
</DataTemplate> | ||
</CollectionView.ItemTemplate> | ||
</CollectionView> | ||
</RefreshView> | ||
</Grid> | ||
</controls:TestContentPage> |
Oops, something went wrong.