diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Issue24414Test.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Issue24414Test.png index 70df9485b73e..1f3ca951928b 100644 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Issue24414Test.png and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Issue24414Test.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Issue24414Test_1.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Issue24414Test_1.png new file mode 100644 index 000000000000..87e0b8f27731 Binary files /dev/null and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Issue24414Test_1.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Issue24414Test_2.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Issue24414Test_2.png new file mode 100644 index 000000000000..2c3b7e0b3cc7 Binary files /dev/null and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Issue24414Test_2.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Issue24414Test_3.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Issue24414Test_3.png new file mode 100644 index 000000000000..088f43d811c1 Binary files /dev/null and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Issue24414Test_3.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Issue24414Test_4.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Issue24414Test_4.png new file mode 100644 index 000000000000..4e4d91dbf6b7 Binary files /dev/null and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Issue24414Test_4.png differ diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Issue24414Test_5.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Issue24414Test_5.png new file mode 100644 index 000000000000..9b2e44b9da18 Binary files /dev/null and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/Issue24414Test_5.png differ diff --git a/src/Controls/tests/TestCases.HostApp/Elements/CollectionView/CollectionViewCoreGalleryPage.cs b/src/Controls/tests/TestCases.HostApp/Elements/CollectionView/CollectionViewCoreGalleryPage.cs index f9fc61841a5a..c9ee96ba9076 100644 --- a/src/Controls/tests/TestCases.HostApp/Elements/CollectionView/CollectionViewCoreGalleryPage.cs +++ b/src/Controls/tests/TestCases.HostApp/Elements/CollectionView/CollectionViewCoreGalleryPage.cs @@ -3,6 +3,7 @@ using Maui.Controls.Sample.CollectionViewGalleries.GroupingGalleries; using Maui.Controls.Sample.CollectionViewGalleries.HeaderFooterGalleries; using Maui.Controls.Sample.CollectionViewGalleries.ItemSizeGalleries; +using Maui.Controls.Sample.CollectionViewGalleries.PerformanceGalleries; using Maui.Controls.Sample.CollectionViewGalleries.SelectionGalleries; namespace Maui.Controls.Sample.CollectionViewGalleries @@ -45,7 +46,8 @@ public CollectionViewCoreGalleryContentPage() // ItemsFromViewModelShouldBeSelected (src\Compatibility\ControlGallery\src\Issues.Shared\CollectionViewBoundMultiSelection.cs) TestBuilder.NavButton("Selection Galleries", () => new SelectionGallery(), Navigation), TestBuilder.NavButton("Item Size Galleries", () => new ItemsSizeGallery(), Navigation), - TestBuilder.NavButton("EmptyView Galleries", () => new EmptyViewGallery(), Navigation) + TestBuilder.NavButton("EmptyView Galleries", () => new EmptyViewGallery(), Navigation), + TestBuilder.NavButton("Performance Galleries", () => new ShadowBenchmark(), Navigation), } } }; diff --git a/src/Controls/tests/TestCases.HostApp/Elements/CollectionView/PerformanceGalleries/ShadowBenchmark.xaml b/src/Controls/tests/TestCases.HostApp/Elements/CollectionView/PerformanceGalleries/ShadowBenchmark.xaml new file mode 100644 index 000000000000..c69af2c4aa45 --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/Elements/CollectionView/PerformanceGalleries/ShadowBenchmark.xaml @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/Elements/CollectionView/PerformanceGalleries/ShadowBenchmark.xaml.cs b/src/Controls/tests/TestCases.HostApp/Elements/CollectionView/PerformanceGalleries/ShadowBenchmark.xaml.cs new file mode 100644 index 000000000000..94cd945b5025 --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/Elements/CollectionView/PerformanceGalleries/ShadowBenchmark.xaml.cs @@ -0,0 +1,67 @@ +namespace Maui.Controls.Sample.CollectionViewGalleries.PerformanceGalleries +{ + public class ShadowBenchmarkShell : Shell + { + public ShadowBenchmarkShell() + { + FlyoutBehavior = FlyoutBehavior.Flyout; + Items.Add(new ShellContent + { + Content = new ShadowBenchmark(), + Title = "Shadow Benchmark" + }); + } + } + + public partial class ShadowBenchmark : ContentPage + { + public ShadowBenchmark() + { + BindingContext = new ShadowBenchmarkViewModel(); + InitializeComponent(); + } + } + + public class User + { + public string Name { get; set; } + public string Image { get; set; } + public Color Color { get; set; } + public string From { get; set; } + } + + public class Post + { + public string Title { get; set; } + public string Content { get; set; } + public string Image { get; set; } + public string Likes { get; set; } + public User User { get; set; } + public DateTime CreatedAt { get; set; } + } + + public class ShadowBenchmarkViewModel + { + public List Posts { get; } = GetData(); + + static List GetData() + { + var posts = new List(); + + User user = new User + { + Name = "Lorem ipsum", + Image = "oasis.jpg", + Color = Color.FromArgb("#62D7FB"), + From = "Lorem ipsum" + }; + + for(int i = 0; i < 1000; i++) + { + posts.Add(new Post { Title = $"Lorem ipsum {i + 1} dolor sit amet, consectetur adipiscing elit", Image = "photo21314.jpg", Likes = "1k", User = user }); + } + + return posts; + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla39489.cs b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla39489.cs index 61f1c43cadb8..92676098be34 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla39489.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Bugzilla/Bugzilla39489.cs @@ -8,7 +8,7 @@ public class Bugzilla39489 : TestNavigationPage { protected override void Init() { - PushAsync(new Bz39489Content()); + PushAsync(new Bz39489Root()); } } @@ -29,44 +29,51 @@ public Bz39489Map() } } - - public class Bz39489Content : ContentPage + public class Bz39489Root : ContentPage { - static int s_count; - - public Bz39489Content() + public Bz39489Root() { - Interlocked.Increment(ref s_count); - Debug.WriteLine($">>>>> Bz39489Content Bz39489Content 54: Constructor, count is {s_count}"); - var button = new Button { AutomationId = "NewPage", Text = "New Page" }; - var gcbutton = new Button { AutomationId = "GC", Text = "GC" }; - - var map = new Bz39489Map(); - button.Clicked += Button_Clicked; gcbutton.Clicked += GCbutton_Clicked; - - Content = new StackLayout { Children = { button, gcbutton, map } }; + Content = new VerticalStackLayout { button, gcbutton }; } void GCbutton_Clicked(object sender, EventArgs e) { - System.Diagnostics.Debug.WriteLine(">>>>>>>> Running Garbage Collection"); + Debug.WriteLine(">>>>>>>> Running Garbage Collection"); GarbageCollectionHelper.Collect(); - System.Diagnostics.Debug.WriteLine($">>>>>>>> GC.GetTotalMemory = {GC.GetTotalMemory(true):n0}"); + Debug.WriteLine($">>>>>>>> GC.GetTotalMemory = {GC.GetTotalMemory(true):n0}"); } void Button_Clicked(object sender, EventArgs e) { Navigation.PushAsync(new Bz39489Content()); } + } + + + public class Bz39489Content : ContentPage + { + static int s_count; + + public Bz39489Content() + { + Interlocked.Increment(ref s_count); + Debug.WriteLine($">>>>> Bz39489Content: Constructor, count is {s_count}"); + + var label = new Label { AutomationId = "StubLabel", Text = "Now press the back button." }; + + var map = new Bz39489Map(); + + Content = new StackLayout { Children = { label, map } }; + } ~Bz39489Content() { Interlocked.Decrement(ref s_count); - Debug.WriteLine($">>>>> Bz39489Content ~Bz39489Content 82: Destructor, count is {s_count}"); + Debug.WriteLine($">>>>> Bz39489Content: Destructor, count is {s_count}"); } } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue24414.xaml b/src/Controls/tests/TestCases.HostApp/Issues/Issue24414.xaml index ad3faf02592f..37ecf63ef0bd 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue24414.xaml +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue24414.xaml @@ -4,39 +4,342 @@ x:Class="Maui.Controls.Sample.Issues.Issue24414" Title="Issue24414"> - -