From d890e6bdb7b3ac13b06f40f284ff7748a80c3fb0 Mon Sep 17 00:00:00 2001 From: Shane Neuville Date: Sun, 8 Feb 2026 16:39:48 -0600 Subject: [PATCH] Clean up Android edge-to-edge layout - Remove custom SetDecorFitsSystemWindows/SetStatusBarColor from MainActivity (.NET 10 MAUI handles edge-to-edge natively via ContentPage defaults) - Remove redundant body padding-bottom from app.css (chat input area already handles bottom safe area via --nav-bar-height CSS variable) - Remove unnecessary Grid SafeAreaEdges wrapper from MainPage.xaml - Add SetFitsSystemWindows(false) on WebView for proper edge-to-edge rendering --- MainPage.xaml | 3 +-- MainPage.xaml.cs | 1 + Platforms/Android/MainActivity.cs | 15 --------------- wwwroot/app.css | 2 -- 4 files changed, 2 insertions(+), 19 deletions(-) diff --git a/MainPage.xaml b/MainPage.xaml index 8b8be5f9c4..3f2a335e26 100644 --- a/MainPage.xaml +++ b/MainPage.xaml @@ -1,8 +1,7 @@ + x:Class="AutoPilot.App.MainPage"> diff --git a/MainPage.xaml.cs b/MainPage.xaml.cs index 64bf60cd17..1ee0ddb469 100644 --- a/MainPage.xaml.cs +++ b/MainPage.xaml.cs @@ -25,6 +25,7 @@ public MainPage() private void OnBlazorWebViewInitialized(object? sender, BlazorWebViewInitializedEventArgs e) { var webView = e.WebView; + // Wait for layout so WindowInsets are available webView.ViewTreeObserver!.GlobalLayout += (s, args) => { diff --git a/Platforms/Android/MainActivity.cs b/Platforms/Android/MainActivity.cs index da5fd67fe6..72fc7b5044 100644 --- a/Platforms/Android/MainActivity.cs +++ b/Platforms/Android/MainActivity.cs @@ -1,24 +1,9 @@ using Android.App; using Android.Content.PM; -using Android.OS; -using Android.Views; -using AndroidX.Core.View; namespace AutoPilot.App; [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] public class MainActivity : MauiAppCompatActivity { - protected override void OnCreate(Bundle? savedInstanceState) - { - base.OnCreate(savedInstanceState); - - // Edge-to-edge with transparent system bars - if (Window != null) - { - WindowCompat.SetDecorFitsSystemWindows(Window, false); - Window.SetStatusBarColor(Android.Graphics.Color.Transparent); - Window.SetNavigationBarColor(Android.Graphics.Color.Transparent); - } - } } diff --git a/wwwroot/app.css b/wwwroot/app.css index 3e501426b6..111c395318 100644 --- a/wwwroot/app.css +++ b/wwwroot/app.css @@ -2,8 +2,6 @@ html, body { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: var(--app-font-size, 20px); color: #a0b4cc; - /* Android bottom nav bar safe area */ - padding-bottom: var(--nav-bar-height, env(safe-area-inset-bottom, 0px)); } a, .btn-link {