Skip to content
Merged
Changes from all commits
Commits
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
24 changes: 20 additions & 4 deletions src/Core/src/Platform/Android/MauiWindowInsetListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,26 @@ public MauiWindowInsetListener() : base(DispatchModeStop)
contentView?.SetPadding(0, 0, 0, 0);
}

// Pass insets through unconsumed so child views receive them intact.
// Bottom: BottomNavigationView needs the nav bar inset to extend its background in Edge-to-Edge mode (Issue #33344).
// Top: SafeAreaExtensions handles per-view overlap, avoiding double-padding.
return insets;
// Consume top inset when AppBar is visible — it already pads itself, so downstream
// views must not receive a top inset or SafeAreaExtensions will double-apply it.
// Bottom inset is passed through unconsumed so BottomNavigationView can extend its
// background into the system navigation bar area (issue #33344).
var newSystemBars = Insets.Of(
systemBars?.Left ?? 0,
appBarHasContent ? 0 : systemBars?.Top ?? 0,
systemBars?.Right ?? 0,
systemBars?.Bottom ?? 0) ?? Insets.None;

var newDisplayCutout = Insets.Of(
displayCutout?.Left ?? 0,
appBarHasContent ? 0 : displayCutout?.Top ?? 0,
displayCutout?.Right ?? 0,
displayCutout?.Bottom ?? 0) ?? Insets.None;

return new WindowInsetsCompat.Builder(insets)
?.SetInsets(WindowInsetsCompat.Type.SystemBars(), newSystemBars)
?.SetInsets(WindowInsetsCompat.Type.DisplayCutout(), newDisplayCutout)
?.Build() ?? insets;
}

public void TrackView(AView view)
Expand Down
Loading