forked from dotnet/maui
-
Notifications
You must be signed in to change notification settings - Fork 0
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
8 changed files
with
130 additions
and
0 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
Binary file added
BIN
+33.9 KB
.../TestCases.Android.Tests/snapshots/android/HeaderShouldNotCollapseWithItems.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions
43
src/Controls/tests/TestCases.HostApp/Issues/Issue12429.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,43 @@ | ||
<?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.Issue12429" | ||
x:Name="Self" | ||
Title="Issue12429"> | ||
<Grid RowDefinitions="Auto,*"> | ||
<HorizontalStackLayout Grid.Row="0"> | ||
<Button | ||
Command="{Binding AddCommand}" | ||
HorizontalOptions="Center" | ||
AutomationId="button" | ||
Text="Add" /> | ||
</HorizontalStackLayout> | ||
|
||
<CollectionView | ||
Grid.Row="1" | ||
ItemsSource="{Binding ItemList}"> | ||
|
||
<CollectionView.Header> | ||
<VerticalStackLayout> | ||
<VerticalStackLayout BindableLayout.ItemsSource="{Binding BindingContext.ItemListHeader, Source={x:Reference Self}}"> | ||
<BindableLayout.ItemTemplate> | ||
<DataTemplate> | ||
<Label Padding="10" Text="{Binding .}" /> | ||
</DataTemplate> | ||
</BindableLayout.ItemTemplate> | ||
</VerticalStackLayout> | ||
<BoxView | ||
Margin="0,5" | ||
HeightRequest="2" | ||
Color="Black" /> | ||
</VerticalStackLayout> | ||
</CollectionView.Header> | ||
|
||
<CollectionView.ItemTemplate> | ||
<DataTemplate> | ||
<Label Padding="10" Text="{Binding .}" /> | ||
</DataTemplate> | ||
</CollectionView.ItemTemplate> | ||
</CollectionView> | ||
</Grid> | ||
</ContentPage> |
24 changes: 24 additions & 0 deletions
24
src/Controls/tests/TestCases.HostApp/Issues/Issue12429.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,24 @@ | ||
using System.Collections.ObjectModel; | ||
using Microsoft.Maui.Controls; | ||
using Microsoft.Maui.Controls.Xaml; | ||
|
||
namespace Maui.Controls.Sample.Issues; | ||
|
||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
[Issue(IssueTracker.Github, 12429, "[iOS] CollectionView Items display issue when Header is resized", PlatformAffected.iOS)] | ||
|
||
public partial class Issue12429 : ContentPage | ||
{ | ||
public ObservableCollection<string> ItemList { get; } | ||
public ObservableCollection<string> ItemListHeader { get; } | ||
|
||
public Command AddCommand => new(() => ItemListHeader.Add($"HeaderItem{ItemListHeader.Count + 1}")); | ||
|
||
public Issue12429() | ||
{ | ||
InitializeComponent(); | ||
ItemList = new() { "Item1", "Item2", "Itme3" }; | ||
ItemListHeader = new() { "HeaderItem1" }; | ||
BindingContext = this; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12429.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,28 @@ | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
||
public class Issue12429 : _IssuesUITest | ||
{ | ||
public override string Issue => "[iOS] CollectionView Items display issue when Header is resized"; | ||
|
||
public Issue12429(TestDevice device) : base(device) | ||
{ } | ||
|
||
[Test] | ||
[Category(UITestCategories.CollectionView)] | ||
public async Task HeaderShouldNotCollapseWithItems() | ||
{ | ||
App.WaitForElement("button"); | ||
App.Click("button"); | ||
App.Click("button"); | ||
App.Click("button"); | ||
|
||
await Task.Delay(500); | ||
|
||
//The test passes of header has 4 elements that don't overlap with the collection view's items | ||
VerifyScreenshot(); | ||
} | ||
} |
Binary file added
BIN
+36.8 KB
...ls/tests/TestCases.iOS.Tests/snapshots/ios/HeaderShouldNotCollapseWithItems.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.33 KB
src/Controls/tests/UITests/snapshots/windows/HeaderShouldNotCollapseWithItems.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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