Skip to content

Commit

Permalink
Revert "Fix crash removing items in ListView (#7411)" (#7418)
Browse files Browse the repository at this point in the history
This reverts commit 4b64fd9.
  • Loading branch information
rmarinho committed May 24, 2022
1 parent 05dd179 commit 8d2520b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
2 changes: 1 addition & 1 deletion src/Core/src/Handlers/Layout/LayoutHandler.Android.cs
Expand Up @@ -40,7 +40,7 @@ public override void SetVirtualView(IView view)

foreach (var child in VirtualView.OrderByZIndex())
{
PlatformView.SafelyAddView(child.ToPlatform(MauiContext));
PlatformView.AddView(child.ToPlatform(MauiContext));
}
}

Expand Down
8 changes: 0 additions & 8 deletions src/Core/src/Platform/Android/ViewGroupExtensions.cs
Expand Up @@ -6,14 +6,6 @@ namespace Microsoft.Maui.Platform
{
public static class ViewGroupExtensions
{
public static void SafelyAddView(this AViewGroup viewGroup, AView child)
{
if (child.Parent != null)
child.RemoveFromParent();

viewGroup.AddView(child);
}

public static IEnumerable<T> GetChildrenOfType<T>(this AViewGroup viewGroup) where T : AView
{
for (var i = 0; i < viewGroup.ChildCount; i++)
Expand Down

0 comments on commit 8d2520b

Please sign in to comment.