-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup lane to run CV2 and CV1 tests (#25719)
* Setup lane to run CV2 and CV1 tests * - fix cake * - fix args * - fix * - yaml * - maybe * - force CV2 for failing CV1 scenarios * Update CarouselViewLoopNoFreeze.cs * Update Issue12574.cs * - force CV2
- Loading branch information
Showing
18 changed files
with
202 additions
and
51 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
68 changes: 68 additions & 0 deletions
68
src/Controls/tests/TestCases.HostApp/CollectionViewHostBuilderExtentions.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,68 @@ | ||
|
||
#if IOS || MACCATALYST | ||
using Foundation; | ||
#endif | ||
|
||
namespace Maui.Controls.Sample | ||
{ | ||
|
||
class CollectionView1 : CollectionView{} | ||
class CollectionView2 : CollectionView{} | ||
|
||
|
||
class CarouselView1 : CarouselView{} | ||
class CarouselView2 : CarouselView{} | ||
|
||
public static partial class CollectionViewHostBuilderExtentions | ||
{ | ||
/// <summary> | ||
/// Configure the .NET MAUI app to listen for fold-related events | ||
/// in the Android lifecycle. Ensures <see cref="Microsoft.Maui.Controls.Foldable.TwoPaneView"/> | ||
/// can detect and layout around a hinge or screen fold. | ||
/// </summary> | ||
/// <remarks> | ||
/// Relies on Jetpack Window Manager to detect and respond to | ||
/// foldable device features and capabilities. | ||
/// </remarks> | ||
public static MauiAppBuilder ConfigureCollectionViewHandlers(this MauiAppBuilder builder) | ||
{ | ||
|
||
#if IOS || MACCATALYST | ||
builder.ConfigureMauiHandlers(handlers => | ||
{ | ||
bool cv2Handlers = false; | ||
foreach(var en in NSProcessInfo.ProcessInfo.Environment) | ||
{ | ||
if ($"{en.Key}" == "TEST_CONFIGURATION_ARGS") | ||
{ | ||
cv2Handlers = $"{en.Value}".Contains("CollectionView2", StringComparison.OrdinalIgnoreCase); | ||
break; | ||
} | ||
} | ||
|
||
if (cv2Handlers) | ||
{ | ||
Console.WriteLine($"Using CollectionView2 handlers"); | ||
handlers.AddHandler<Microsoft.Maui.Controls.CollectionView, Microsoft.Maui.Controls.Handlers.Items2.CollectionViewHandler2>(); | ||
handlers.AddHandler<Microsoft.Maui.Controls.CarouselView, Microsoft.Maui.Controls.Handlers.Items2.CarouselViewHandler2>(); | ||
} | ||
else | ||
{ | ||
Console.WriteLine($"Using CollectionView handlers"); | ||
handlers.AddHandler<Microsoft.Maui.Controls.CollectionView, Microsoft.Maui.Controls.Handlers.Items.CollectionViewHandler>(); | ||
handlers.AddHandler<Microsoft.Maui.Controls.CarouselView, Microsoft.Maui.Controls.Handlers.Items.CarouselViewHandler>(); | ||
} | ||
|
||
handlers.AddHandler<CollectionView1, Microsoft.Maui.Controls.Handlers.Items.CollectionViewHandler>(); | ||
handlers.AddHandler<CarouselView1, Microsoft.Maui.Controls.Handlers.Items.CarouselViewHandler>(); | ||
|
||
|
||
handlers.AddHandler<CollectionView2, Microsoft.Maui.Controls.Handlers.Items2.CollectionViewHandler2>(); | ||
handlers.AddHandler<CarouselView2, Microsoft.Maui.Controls.Handlers.Items2.CarouselViewHandler2>(); | ||
}); | ||
#endif | ||
|
||
return builder; | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.