Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6b0ac22
sandbox sample
NirmalKumarYuvaraj Dec 3, 2025
6f64068
minor change
NirmalKumarYuvaraj Dec 3, 2025
3296a25
fix
NirmalKumarYuvaraj Dec 3, 2025
0d2c84f
added test case
NirmalKumarYuvaraj Dec 5, 2025
cdf9b23
added snapshots
NirmalKumarYuvaraj Dec 5, 2025
e2beb37
Fix SafeAreaExtensions full-screen detection and improve Issue32941 test
PureWeen Dec 6, 2025
f1052a2
Replace 95% threshold with parent-based detection in SafeAreaExtensions
PureWeen Dec 6, 2025
6dc61b0
Add ISafeAreaIgnoredContainer to disable safe area for ListView/Table…
PureWeen Dec 6, 2025
f9fd9e7
Remove all ISafeAreaIgnoredContainer PublicAPI entries
PureWeen Dec 7, 2025
967d469
Fix ISafeAreaIgnoredContainer logic to check parent hierarchy
PureWeen Dec 7, 2025
7e11c0e
Fix ISafeAreaIgnoredContainer to not skip view tracking
PureWeen Dec 7, 2025
a6afe09
Remove ISafeAreaIgnoredContainer from ViewCell
PureWeen Dec 7, 2025
70d85e5
Add SafeAreaEdges.Container to pages with ListView/TableView as root …
PureWeen Dec 7, 2025
0c66629
Consolidate redundant parent check in SafeAreaExtensions
PureWeen Dec 7, 2025
367e5c9
Delete src/Core/AndroidNative/build/reports/problems/problems-report.…
PureWeen Dec 7, 2025
bb7567c
Fix Issue5924 and ShellInsets ListViewPage with SafeAreaEdges.Container
PureWeen Dec 7, 2025
9178e56
Fix Issue1658 and Issue6258 with SafeAreaEdges.Container
PureWeen Dec 8, 2025
ddde512
Refactor: Move ISafeAreaIgnoredContainer check to FindListenerForView
PureWeen Dec 8, 2025
6ee203c
Remove ISafeAreaIgnoredContainer logic from SafeAreaExtensions
PureWeen Dec 8, 2025
a8909e0
Add Issue33034 test and fix SafeArea for ListView/TableView children
PureWeen Dec 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Controls/src/Core/ListView/ListView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Microsoft.Maui.Controls
{
/// <summary>An <see cref="Microsoft.Maui.Controls.ItemsView{T}"/> that displays a collection of data as a vertical list.</summary>
[Obsolete("ListView is deprecated. Please use CollectionView instead.")]
public class ListView : ItemsView<Cell>, IListViewController, IElementConfiguration<ListView>, IVisualTreeElement
public class ListView : ItemsView<Cell>, IListViewController, IElementConfiguration<ListView>, IVisualTreeElement, ISafeAreaIgnoredContainer
{
// The ListViewRenderer has some odd behavior with LogicalChildren
// https://github.com/xamarin/Xamarin.Forms/pull/12057
Expand Down
2 changes: 1 addition & 1 deletion src/Controls/src/Core/TableView/TableView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Microsoft.Maui.Controls
/// <include file="../../docs/Microsoft.Maui.Controls/TableView.xml" path="Type[@FullName='Microsoft.Maui.Controls.TableView']/Docs/*" />
[Obsolete("Please use CollectionView instead.")]
[ContentProperty(nameof(Root))]
public class TableView : View, ITableViewController, IElementConfiguration<TableView>, IVisualTreeElement
public class TableView : View, ITableViewController, IElementConfiguration<TableView>, ISafeAreaIgnoredContainer, IVisualTreeElement
{
/// <summary>Bindable property for <see cref="RowHeight"/>.</summary>
public static readonly BindableProperty RowHeightProperty = BindableProperty.Create(nameof(RowHeight), typeof(int), typeof(TableView), -1);
Expand Down
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NirmalKumarYuvaraj can you evaluate if this is a regression or an expected visual change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PureWeen , This is a regression. I will check and update

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ public class Bugzilla32040 : TestContentPage
{
protected override void Init()
{
SafeAreaEdges = new SafeAreaEdges(SafeAreaRegions.Container);

var switchCell = new SwitchCell { Text = "blahblah", AutomationId = "blahblah" };
switchCell.Tapped += (s, e) =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ public ContentPage32206()
Interlocked.Increment(ref LandingPage32206.Counter);
System.Diagnostics.Debug.WriteLine("Page: " + LandingPage32206.Counter);

SafeAreaEdges = new SafeAreaEdges(SafeAreaRegions.Container);

Content = new ListView
{
ItemsSource = new List<string> { "Apple", "Banana", "Cherry" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public class Bugzilla33578 : TestContentPage
{
protected override void Init()
{
SafeAreaEdges = new SafeAreaEdges(SafeAreaRegions.Container);
Content = new TableView
{
AutomationId = "table",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public ContentPage43941()
Interlocked.Increment(ref LandingPage43941.Counter);
System.Diagnostics.Debug.WriteLine("Page: " + LandingPage43941.Counter);

SafeAreaEdges = new SafeAreaEdges(SafeAreaRegions.Container);

var list = new List<int>();
for (var i = 0; i < 30; i++)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public string[] Items

protected override void Init()
{

SafeAreaEdges = new SafeAreaEdges(SafeAreaRegions.Container);
Content = new ListView
{
ItemsSource = Items,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class Bugzilla52533 : TestContentPage

protected override void Init()
{
SafeAreaEdges = new SafeAreaEdges(SafeAreaRegions.Container);
Content = new ListView { ItemTemplate = new DataTemplate(typeof(GridViewCell)), ItemsSource = Enumerable.Range(0, 10) };
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public ListViewPage()
{
BindingContext = this;

SafeAreaEdges = new SafeAreaEdges(SafeAreaRegions.Container);

var listView = new ListView(ListViewCachingStrategy.RecycleElement)
{
ItemTemplate = new DataTemplate(() =>
Expand Down
84 changes: 84 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue32941.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 32941, "Label Overlapped by Android Status Bar When Using SafeAreaEdges=Container in .NET MAUI", PlatformAffected.Android)]
public class Issue32941 : TestShell
{
protected override void Init()
{
var shellContent1 = new ShellContent
{
Title = "Home",
Route = "MainPage",
Content = new Issue32941_MainPage()
};
var shellContent2 = new ShellContent
{
Title = "SignOut",
Route = "SignOutPage",
Content = new Issue32941_SignOutPage()
};
Items.Add(shellContent1);
Items.Add(shellContent2);
}
}

public class Issue32941_MainPage : ContentPage
{
public Issue32941_MainPage()
{
var goToSignOutButton = new Button
{
Text = "Go to SignOut",
AutomationId = "GoToSignOutButton"
};
goToSignOutButton.Clicked += async (s, e) => await Shell.Current.GoToAsync("//SignOutPage", false);

Content = new VerticalStackLayout
{
Spacing = 20,
Padding = new Thickness(20),
Children =
{
new Label
{
Text = "Main Page",
FontSize = 24,
AutomationId = "MainPageLabel"
},
goToSignOutButton
}
};
}
}

public class Issue32941_SignOutPage : ContentPage
{
public Issue32941_SignOutPage()
{
Shell.SetNavBarIsVisible(this, false);
SafeAreaEdges = new SafeAreaEdges(SafeAreaRegions.Container);

var backButton = new Button
{
Text = "Back to Main",
AutomationId = "BackButton"
};
backButton.Clicked += async (s, e) => await Shell.Current.GoToAsync("//MainPage", true);

Content = new VerticalStackLayout
{
BackgroundColor = Colors.White,
Children =
{
new Label
{
Text = "SignOut / Session Expiry Page",
FontSize = 24,
BackgroundColor = Colors.Yellow,
AutomationId = "SignOutLabel"
},
backButton
}
};
}
}
7 changes: 7 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue33034.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<local:TestShell xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Maui.Controls.Sample.Issues"
x:Class="Maui.Controls.Sample.Issues.Issue33034"
Title="Issue 33034">
</local:TestShell>
41 changes: 41 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue33034.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;

namespace Maui.Controls.Sample.Issues;

[XamlCompilation(XamlCompilationOptions.Compile)]
[Issue(IssueTracker.Github, 33034, "SafeAreaEdges works correctly only on the first tab in Shell. Other tabs have content colliding with the display cutout in the landscape mode.", PlatformAffected.Android)]
public partial class Issue33034 : TestShell
{
public Issue33034()
{
InitializeComponent();
}

protected override void Init()
{
// Create TabBar with two tabs using the same content page
var tabBar = new TabBar();

var tab = new Tab { Title = "Tabs" };

tab.Items.Add(new ShellContent
{
Title = "First Tab",
AutomationId = "FirstTab",
ContentTemplate = new DataTemplate(typeof(Issue33034TabContent)),
Route = "tab1"
});

tab.Items.Add(new ShellContent
{
Title = "Second Tab",
AutomationId = "SecondTab",
ContentTemplate = new DataTemplate(typeof(Issue33034TabContent)),
Route = "tab2"
});

tabBar.Items.Add(tab);
Items.Add(tabBar);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?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.Issue33034TabContent"
Title="Tab Content">

<ScrollView>
<VerticalStackLayout Spacing="10" Padding="10">
<!-- Label positioned at the left edge to test safe area -->
<Label
x:Name="LeftEdgeLabel"
AutomationId="LeftEdgeLabel"
Text="LEFT EDGE - Should have safe area padding"
FontSize="18"
FontAttributes="Bold"
BackgroundColor="Red"
TextColor="White"
Padding="10"
HorizontalOptions="Start"/>

<!-- Some content to fill the page -->
<BoxView
AutomationId="ContentBox"
Color="Blue"
HeightRequest="100"
HorizontalOptions="Fill"/>

<Label
Text="This content should respect safe area on ALL tabs in landscape mode."
FontSize="14"
TextColor="Gray"
HorizontalTextAlignment="Center"/>

<Label
Text="Bug: On second tab, content collides with display cutout/notch in landscape."
FontSize="12"
TextColor="DarkRed"
HorizontalTextAlignment="Center"/>
</VerticalStackLayout>
</ScrollView>
</ContentPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;

namespace Maui.Controls.Sample.Issues;

[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class Issue33034TabContent : ContentPage
{
public Issue33034TabContent()
{
InitializeComponent();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public partial class Issue5924 : ContentPage
public Issue5924()
{
InitializeComponent();
SafeAreaEdges = new SafeAreaEdges(SafeAreaRegions.Container);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class Issue1028 : TestContentPage
// Issue1028, ViewCell with StackLayout causes exception when nested in a table section. This occurs when the app's root page is a ContentPage with a TableView.
protected override void Init()
{
SafeAreaEdges = new SafeAreaEdges(SafeAreaRegions.Container);
Content = new TableView
{
Root = new TableRoot("Table Title") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ protected override void Init()
{
var page = new ContentPage();

page.SafeAreaEdges = new SafeAreaEdges(SafeAreaRegions.Container);

PushAsync(page);

page.Content = new ListView()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ protected override void Init()
{
var page = new ContentPage();

page.SafeAreaEdges = new SafeAreaEdges(SafeAreaRegions.Container);

PushAsync(page);

page.Content = new ListView()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ void ListViewPage()
{
var page = CreateContentPage();

page.SafeAreaEdges = new SafeAreaEdges(SafeAreaRegions.Container);

page.Content = new Microsoft.Maui.Controls.ListView(ListViewCachingStrategy.RecycleElement)
{
ItemTemplate = new DataTemplate(() =>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS // SafeAreaEdges not supported on Catalyst and Windows
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue32941 : _IssuesUITest
{
public Issue32941(TestDevice testDevice) : base(testDevice)
{
}

public override string Issue => "Label Overlapped by Android Status Bar When Using SafeAreaEdges=Container in .NET MAUI";

[Test]
[Category(UITestCategories.SafeAreaEdges)]
public void ShellContentShouldRespectSafeAreaEdges_After_Navigation()
{
App.WaitForElement("MainPageLabel");
App.Tap("GoToSignOutButton");
App.WaitForElement("SignOutLabel");

// Get the position of the label
var labelRect = App.FindElement("SignOutLabel").GetRect();

// The label should be positioned below the status bar (Y coordinate should be > 0)
// On Android with notch, status bar is typically 24-88dp depending on device
// The label should have adequate top padding from SafeAreaEdges=Container
Assert.That(labelRect.Y, Is.GreaterThan(0), "Label should not be at Y=0 (would be under status bar)");

// Verify the label is not overlapped by checking it has reasonable top spacing
// A label at Y < 20 is likely overlapped by the status bar
Assert.That(labelRect.Y, Is.GreaterThanOrEqualTo(20),
"Label Y position should be at least 20 pixels from top to avoid status bar overlap");
}
}
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue33034 : _IssuesUITest
{
public override string Issue => "SafeAreaEdges works correctly only on the first tab in Shell. Other tabs have content colliding with the display cutout in the landscape mode.";

public Issue33034(TestDevice device) : base(device) { }

[Test]
[Category(UITestCategories.SafeAreaEdges)]
public void SafeAreaShouldWorkOnAllShellTabs()
{
// Wait for the first tab to load
App.WaitForElement("LeftEdgeLabel");

// Get the X position of the left edge label on the first tab
var firstTabLabelRect = App.FindElement("LeftEdgeLabel").GetRect();
var firstTabLeftPosition = firstTabLabelRect.X;

// The label should have proper left padding (safe area inset)
// With our SafeArea fix, it should be > 0
Assert.That(firstTabLeftPosition, Is.GreaterThan(0),
$"Left edge label should have safe area inset on first tab. Position: {firstTabLeftPosition}");
}
}
}
Loading
Loading