Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f9d624a
fix code update
praveenkumarkarunanithi Jul 7, 2026
1089273
fix code modified
praveenkumarkarunanithi Jul 9, 2026
36cbe75
fix and test update.
praveenkumarkarunanithi Jul 22, 2026
6a470b8
Merge branch 'dotnet:main' into fix-36269
praveenkumarkarunanithi Aug 26, 2026
295b287
fix update
praveenkumarkarunanithi Aug 26, 2026
574558a
remove comments
praveenkumarkarunanithi Aug 26, 2026
d7237e4
Update SafeAreaExtensions.cs
praveenkumarkarunanithi Aug 26, 2026
d77390f
Update MauiScrollView.cs
praveenkumarkarunanithi Sep 7, 2026
df8abcc
test image update
praveenkumarkarunanithi Sep 8, 2026
dcfed41
Fix /issue triage activation hash after shared import changes (#39190)
kubaflo Oct 6, 2026
7d38fd0
CI-fix automation: Fix startup deadlines and producer helper guidance…
PureWeen Oct 6, 2026
84b1fb3
Bump the aspnetcore group with 3 updates (#39209)
dependabot[bot] Oct 7, 2026
6d81224
Keep /issue triage reports artifact-only while applying real labels (…
kubaflo Oct 7, 2026
b926f05
Resolve successfully handled /issue triage command comments (#39235)
kubaflo Oct 7, 2026
9280dee
Bump the windowsappsdk group with 1 update (#39245)
dependabot[bot] Oct 8, 2026
d356b4b
Fix BlazorWebView root component subscriptions on disconnect (#39247)
sheiksyedm Oct 8, 2026
c7588ae
Merge remote-tracking branch 'upstream/main' into fix-36269
praveenkumarkarunanithi Oct 8, 2026
b5faab4
Update NavBarHidden.png
praveenkumarkarunanithi Oct 8, 2026
558aa0e
Revert "Update NavBarHidden.png"
praveenkumarkarunanithi Oct 8, 2026
0e3b59a
Update NavBarHidden.png
praveenkumarkarunanithi Oct 8, 2026
30c9de9
Merge branch 'inflight/current' into fix-36269
kubaflo Oct 9, 2026
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
92 changes: 92 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue36269.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 36269, "SafeAreaEdges bottom padding is lost when the Shell TabBar is hidden at runtime on a page that started above the navigation bar", PlatformAffected.Android)]
public class Issue36269 : TestShell
{
protected override void Init()
{
var tabBar = new TabBar();

tabBar.Items.Add(new ShellContent
{
Title = "Page1",
AutomationId = "FirstTab",
ContentTemplate = new DataTemplate(typeof(Issue36269FirstTab)),
Route = "page1"
});

tabBar.Items.Add(new ShellContent
{
Title = "Page2",
AutomationId = "SecondTab",
ContentTemplate = new DataTemplate(typeof(ContentPage)),
Route = "page2"
});
Comment thread
praveenkumarkarunanithi marked this conversation as resolved.
Resolved

Items.Add(tabBar);
}
}

public class Issue36269FirstTab : ContentPage
{
public Issue36269FirstTab()
{
BackgroundColor = Colors.Black;

var scrollContent = new VerticalStackLayout
{
Padding = new Thickness(16, 16, 16, 48),
Spacing = 16,
Children =
{
new Label { Text = "Page 1", AutomationId = "PageTitleLabel", TextColor = Colors.White, FontSize = 24 },
new Label { Text = "TabBar starts visible; this page is above the nav bar.", TextColor = Colors.White },
}
};

var scrollView = new ScrollView { Content = scrollContent };

var hideTabBarButton = new Button
{
Text = "Hide TabBar",
AutomationId = "HideTabBarButton",
Margin = new Thickness(0, 8, 0, 0)
};
hideTabBarButton.Clicked += (s, e) => Shell.SetTabBarIsVisible(this, false);

var bottomBar = new VerticalStackLayout
{
BackgroundColor = Colors.MediumPurple,
Padding = new Thickness(24, 16, 24, 24),
Children =
{
new BoxView { HeightRequest = 2, Color = Colors.Gray },
new Label
{
Text = "BOTTOM EDGE",
AutomationId = "BottomEdgeLabel",
TextColor = Colors.White,
FontAttributes = FontAttributes.Bold,
HorizontalTextAlignment = TextAlignment.Center,
Margin = new Thickness(0, 8, 0, 0)
},
hideTabBarButton
}
};

var grid = new Grid
{
SafeAreaEdges = SafeAreaEdges.All,
Comment thread
praveenkumarkarunanithi marked this conversation as resolved.
Resolved
RowDefinitions =
{
new RowDefinition { Height = GridLength.Star },
new RowDefinition { Height = GridLength.Auto }
}
};

grid.Add(scrollView, 0, 0);
grid.Add(bottomBar, 0, 1);

Content = grid;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#if ANDROID // Android-only: #36269 is a regression in Android's safe-area inset recompute path.
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue36269 : _IssuesUITest
{
public Issue36269(TestDevice device) : base(device) { }

public override string Issue => "SafeAreaEdges bottom padding is lost when the Shell TabBar is hidden at runtime on a page that started above the navigation bar";

[Test]
[Category(UITestCategories.SafeAreaEdges)]
public void SafeAreaBottomPaddingIsAppliedWhenTabBarHiddenAtRuntime()
Comment thread
praveenkumarkarunanithi marked this conversation as resolved.
Resolved
Comment thread
praveenkumarkarunanithi marked this conversation as resolved.
Resolved
{
App.WaitForElement("HideTabBarButton");
App.Tap("HideTabBarButton");

App.WaitForElement("BottomEdgeLabel");

VerifyScreenshot(retryTimeout: TimeSpan.FromSeconds(2));
Comment thread
praveenkumarkarunanithi marked this conversation as resolved.
Resolved
Comment thread
praveenkumarkarunanithi marked this conversation as resolved.
Resolved
Comment thread
praveenkumarkarunanithi marked this conversation as resolved.
Resolved
Comment thread
praveenkumarkarunanithi marked this conversation as resolved.
Resolved
}
Comment thread
praveenkumarkarunanithi marked this conversation as resolved.
Resolved
}
#endif
8 changes: 7 additions & 1 deletion src/Core/src/Platform/Android/ContentViewGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,13 @@ protected override void OnLayout(bool changed, int left, int top, int right, int

CrossPlatformArrange(destination);

if (_didSafeAreaEdgeConfigurationChange && _isInsetListenerSet)
// Overlap-based safe-area padding is recomputed only on an inset dispatch, SafeAreaEdges change, or
// config change — never on a plain resize. Re-request insets when a safe-area view's bounds change so a
// view that started with zero padding isn't left clipped after it grows into the inset region.
// HasSafeAreaRegions is evaluated last so it only runs for changed, inset-tracked views. See #36269.
if (_isInsetListenerSet &&
(_didSafeAreaEdgeConfigurationChange ||
(changed && SafeAreaExtensions.HasSafeAreaRegions(CrossPlatformLayout))))
Comment thread
praveenkumarkarunanithi marked this conversation as resolved.
Resolved
{
ViewCompat.RequestApplyInsets(this);
_didSafeAreaEdgeConfigurationChange = false;
Expand Down
8 changes: 7 additions & 1 deletion src/Core/src/Platform/Android/LayoutViewGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,13 @@ protected override void OnLayout(bool changed, int l, int t, int r, int b)
ClipBounds = null;
}

if (_didSafeAreaEdgeConfigurationChange && _isInsetListenerSet)
// Overlap-based safe-area padding is recomputed only on an inset dispatch, SafeAreaEdges change, or
// config change — never on a plain resize. Re-request insets when a safe-area view's bounds change so a
// view that started with zero padding isn't left clipped after it grows into the inset region.
// HasSafeAreaRegions is evaluated last so it only runs for changed, inset-tracked views. See #36269.
if (_isInsetListenerSet &&
Comment thread
praveenkumarkarunanithi marked this conversation as resolved.
Resolved
(_didSafeAreaEdgeConfigurationChange ||
(changed && SafeAreaExtensions.HasSafeAreaRegions(CrossPlatformLayout))))
Comment thread
praveenkumarkarunanithi marked this conversation as resolved.
Resolved
{
ViewCompat.RequestApplyInsets(this);
_didSafeAreaEdgeConfigurationChange = false;
Expand Down
24 changes: 24 additions & 0 deletions src/Core/src/Platform/Android/SafeAreaExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,30 @@ internal static SafeAreaRegions GetSafeAreaRegionForEdge(int edge, ICrossPlatfor
return safeAreaView?.IgnoreSafeArea == false ? SafeAreaRegions.Container : SafeAreaRegions.None;
}

internal static bool HasSafeAreaRegions(ICrossPlatformLayout? crossPlatformLayout)
{
if (crossPlatformLayout is null)
{
return false;
}

var safeAreaView2 = GetSafeAreaView2(crossPlatformLayout);
if (safeAreaView2 is not null)
{
for (var edge = 0; edge < 4; edge++)
{
if (safeAreaView2.GetSafeAreaRegionsForEdge(edge) != SafeAreaRegions.None)
{
return true;
}
}

return false;
}

return GetSafeAreaView(crossPlatformLayout)?.IgnoreSafeArea == false;
Comment thread
praveenkumarkarunanithi marked this conversation as resolved.
Resolved
}
Comment thread
praveenkumarkarunanithi marked this conversation as resolved.
Resolved

internal static WindowInsetsCompat? ApplyAdjustedSafeAreaInsetsPx(
WindowInsetsCompat windowInsets,
ICrossPlatformLayout crossPlatformLayout,
Expand Down
Loading