diff --git a/backend/FwLite/FwLiteMaui/MainPage.xaml b/backend/FwLite/FwLiteMaui/MainPage.xaml index 11f4574c9a..b16b9382f1 100644 --- a/backend/FwLite/FwLiteMaui/MainPage.xaml +++ b/backend/FwLite/FwLiteMaui/MainPage.xaml @@ -3,7 +3,8 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:FwLiteMaui" xmlns:shared="clr-namespace:FwLiteShared;assembly=FwLiteShared" - x:Class="FwLiteMaui.MainPage"> + x:Class="FwLiteMaui.MainPage" + SafeAreaEdges="Container"> diff --git a/backend/FwLite/FwLiteMaui/Platforms/Android/MainActivity.cs b/backend/FwLite/FwLiteMaui/Platforms/Android/MainActivity.cs index ee6edadf3a..c8b0d36594 100644 --- a/backend/FwLite/FwLiteMaui/Platforms/Android/MainActivity.cs +++ b/backend/FwLite/FwLiteMaui/Platforms/Android/MainActivity.cs @@ -1,7 +1,9 @@ using Android.App; using Android.Content; using Android.Content.PM; +using Android.Content.Res; using Android.OS; +using AndroidX.Core.View; using FwLiteShared.Auth; using Microsoft.Identity.Client; @@ -16,9 +18,24 @@ public class MainActivity : MauiAppCompatActivity { protected override void OnCreate(Bundle? savedInstanceState) { - //custom style, declared in Android/Resources/values/styles.xml, values-v35 is used based on the android version - Theme?.ApplyStyle(Resource.Style.OptOutEdgeToEdgeEnforcement, force: false); base.OnCreate(savedInstanceState); + ApplyBrandedSystemBars(); + } + + public override void OnConfigurationChanged(Configuration newConfig) + { + base.OnConfigurationChanged(newConfig); + ApplyBrandedSystemBars(); + } + + private void ApplyBrandedSystemBars() + { + if (Window is null) return; + Window.SetBackgroundDrawableResource(Resource.Color.colorPrimaryDark); + var controller = WindowCompat.GetInsetsController(Window, Window.DecorView); + if (controller is null) return; + controller.AppearanceLightStatusBars = false; + controller.AppearanceLightNavigationBars = false; } protected override void OnActivityResult(int requestCode, Result resultCode, Intent? data) diff --git a/backend/FwLite/FwLiteMaui/Platforms/Android/Resources/values-v35/styles.xml b/backend/FwLite/FwLiteMaui/Platforms/Android/Resources/values-v35/styles.xml deleted file mode 100644 index 9df79fe9b4..0000000000 --- a/backend/FwLite/FwLiteMaui/Platforms/Android/Resources/values-v35/styles.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/backend/FwLite/FwLiteMaui/Platforms/Android/Resources/values/styles.xml b/backend/FwLite/FwLiteMaui/Platforms/Android/Resources/values/styles.xml deleted file mode 100644 index 2ad8b4dd86..0000000000 --- a/backend/FwLite/FwLiteMaui/Platforms/Android/Resources/values/styles.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - -