Repository navigation
[Android] Fix stale bottom safe area after Shell tab navigation with TabBarIsVisible=False #36474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kubaflo
merged 21 commits into
dotnet:inflight/current
from
praveenkumarkarunanithi:fix-36269
Oct 9, 2026
Merged
Changes from 3 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
f9d624a
fix code update
praveenkumarkarunanithi 1089273
fix code modified
praveenkumarkarunanithi 36cbe75
fix and test update.
praveenkumarkarunanithi 6a470b8
Merge branch 'dotnet:main' into fix-36269
praveenkumarkarunanithi 295b287
fix update
praveenkumarkarunanithi 574558a
remove comments
praveenkumarkarunanithi d7237e4
Update SafeAreaExtensions.cs
praveenkumarkarunanithi d77390f
Update MauiScrollView.cs
praveenkumarkarunanithi df8abcc
test image update
praveenkumarkarunanithi dcfed41
Fix /issue triage activation hash after shared import changes (#39190)
kubaflo 7d38fd0
CI-fix automation: Fix startup deadlines and producer helper guidance…
PureWeen 84b1fb3
Bump the aspnetcore group with 3 updates (#39209)
dependabot[bot] 6d81224
Keep /issue triage reports artifact-only while applying real labels (…
kubaflo b926f05
Resolve successfully handled /issue triage command comments (#39235)
kubaflo 9280dee
Bump the windowsappsdk group with 1 update (#39245)
dependabot[bot] d356b4b
Fix BlazorWebView root component subscriptions on disconnect (#39247)
sheiksyedm c7588ae
Merge remote-tracking branch 'upstream/main' into fix-36269
praveenkumarkarunanithi b5faab4
Update NavBarHidden.png
praveenkumarkarunanithi 558aa0e
Revert "Update NavBarHidden.png"
praveenkumarkarunanithi 0e3b59a
Update NavBarHidden.png
praveenkumarkarunanithi 30c9de9
Merge branch 'inflight/current' into fix-36269
kubaflo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Binary file added
BIN
+55.2 KB
...ts/android-notch-36/SafeAreaBottomPaddingIsAppliedWhenTabBarHiddenAtRuntime.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37.2 KB
...s/snapshots/android/SafeAreaBottomPaddingIsAppliedWhenTabBarHiddenAtRuntime.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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,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" | ||
| }); | ||
|
|
||
| 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, | ||
|
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; | ||
| } | ||
| } | ||
26 changes: 26 additions & 0 deletions
26
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue36269.cs
This file contains hidden or 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,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() | ||
|
praveenkumarkarunanithi marked this conversation as resolved.
Resolved
praveenkumarkarunanithi marked this conversation as resolved.
Resolved
|
||
| { | ||
| App.WaitForElement("HideTabBarButton"); | ||
| App.Tap("HideTabBarButton"); | ||
|
|
||
| App.WaitForElement("BottomEdgeLabel"); | ||
|
|
||
| VerifyScreenshot(retryTimeout: TimeSpan.FromSeconds(2)); | ||
|
praveenkumarkarunanithi marked this conversation as resolved.
Resolved
praveenkumarkarunanithi marked this conversation as resolved.
Resolved
praveenkumarkarunanithi marked this conversation as resolved.
Resolved
praveenkumarkarunanithi marked this conversation as resolved.
Resolved
|
||
| } | ||
|
praveenkumarkarunanithi marked this conversation as resolved.
Resolved
|
||
| } | ||
| #endif | ||
This file contains hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.