-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fixed the OnPlatform does not work for header property in Collection view #28935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
NanthiniMahalingam
wants to merge
7
commits into
dotnet:main
Choose a base branch
from
NanthiniMahalingam:fix-25124
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d6dba81
Fixed the OnPlatform issue on all the platform
NanthiniMahalingam 3755dd8
Added the test case and modified the fix
NanthiniMahalingam a2e0584
Simplified the fix
NanthiniMahalingam e5e363e
Updated the fix
NanthiniMahalingam 44aa903
Updated the code changes
NanthiniMahalingam 06fc281
Added the android output image
NanthiniMahalingam ceac903
Added the iOS output image
NanthiniMahalingam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
+8.36 KB
...tCases.Android.Tests/snapshots/android/ShouldDisplayHeaderBasedOnOnPlatform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions
32
src/Controls/tests/TestCases.HostApp/Issues/Issue25124.xaml
This file contains hidden or 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,32 @@ | ||
<?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.Issue25124" | ||
Title="Issue25124"> | ||
<Grid> | ||
<CollectionView AutomationId="CollectionView"> | ||
<CollectionView.ItemsSource> | ||
<x:Array Type="{x:Type x:String}"> | ||
<x:String>A</x:String> | ||
<x:String>B</x:String> | ||
</x:Array> | ||
</CollectionView.ItemsSource> | ||
<CollectionView.Header> | ||
<OnPlatform x:TypeArguments="View"> | ||
<On Platform="Android"> | ||
<Label Text="Android Header"/> | ||
</On> | ||
<On Platform="WinUI"> | ||
<Label Text="WinUI Header"/> | ||
</On> | ||
<On Platform="iOS"> | ||
<Label Text="IOS Header"/> | ||
</On> | ||
<On Platform="MacCatalyst"> | ||
<Label Text="Mac Header"/> | ||
</On> | ||
</OnPlatform> | ||
</CollectionView.Header> | ||
</CollectionView> | ||
</Grid> | ||
</ContentPage> |
10 changes: 10 additions & 0 deletions
10
src/Controls/tests/TestCases.HostApp/Issues/Issue25124.xaml.cs
This file contains hidden or 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,10 @@ | ||
namespace Maui.Controls.Sample.Issues; | ||
|
||
[Issue(IssueTracker.Github, 25124, "OnPlatform does not work in the Header and Footer of CollectionView", PlatformAffected.UWP | PlatformAffected.Android | PlatformAffected.iOS | PlatformAffected.macOS)] | ||
public partial class Issue25124 : ContentPage | ||
{ | ||
public Issue25124() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25124.cs
This file contains hidden or 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,22 @@ | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
||
public class Issue25124 : _IssuesUITest | ||
{ | ||
public Issue25124(TestDevice testDevice) : base(testDevice) | ||
{ | ||
} | ||
|
||
public override string Issue => "OnPlatform does not work in the Header and Footer of CollectionView"; | ||
|
||
[Test] | ||
[Category(UITestCategories.CollectionView)] | ||
public void ShouldDisplayHeaderBasedOnOnPlatform() | ||
{ | ||
App.WaitForElement("CollectionView"); | ||
VerifyScreenshot(); | ||
jsuarezruiz marked this conversation as resolved.
Show resolved
Hide resolved
jsuarezruiz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} |
Binary file added
BIN
+25.8 KB
...ests/TestCases.iOS.Tests/snapshots/ios/ShouldDisplayHeaderBasedOnOnPlatform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.