diff --git a/App.xaml.cs b/App.xaml.cs index 70c71a9..a67603d 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -1,61 +1,18 @@ -#if ANDROID -using Android.Graphics.Drawables; -using Android.Views; -using AndroidX.Core.View; -#endif -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Maui.Platform; -using Window = Microsoft.Maui.Controls.Window; - -namespace MauiApp1Net10 -{ +using Window = Microsoft.Maui.Controls.Window; + +namespace MauiApp1Net10 +{ public partial class App : Application { public App() - { - InitializeComponent(); - - } - protected override void OnStart() - { - base.OnStart(); - SetTheme(Application.Current.RequestedTheme); - RequestedThemeChanged += ThemeChangedEvent; - } - - private void SetTheme(AppTheme theme) - { -#if ANDROID - var darkThemeStatusAndNavbarColor = Microsoft.Maui.Graphics.Color.FromArgb("#72e09a"); - var lightThemeStatusAndNavbarColor = Microsoft.Maui.Graphics.Color.FromArgb("#BCCCDC"); - var activity = Platform.CurrentActivity; - var window = activity?.Window; - if (window == null) - return; - //window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds); - //window.ClearFlags(WindowManagerFlags.TranslucentStatus); - - var ac = theme == AppTheme.Dark ? darkThemeStatusAndNavbarColor.ToPlatform() : lightThemeStatusAndNavbarColor.ToPlatform(); - window?.SetBackgroundDrawable(new ColorDrawable(ac)); - //window?.SetStatusBarColor(ac); - //window?.SetNavigationBarColor(ac); - var wicc = WindowCompat.GetInsetsController(window, window?.DecorView); - if (wicc != null) - { - wicc.AppearanceLightStatusBars = theme == AppTheme.Dark ? false : true; - wicc.AppearanceLightNavigationBars = wicc.AppearanceLightStatusBars; - } -#endif - } - - private void ThemeChangedEvent(object? sender, AppThemeChangedEventArgs e) - { - SetTheme(e.RequestedTheme); - } - - protected override Window CreateWindow(IActivationState? activationState) - { + { + InitializeComponent(); + + } + + protected override Window CreateWindow(IActivationState? activationState) + { return new Window(new Tabbed()); } } -} \ No newline at end of file +} diff --git a/MainPage.xaml b/MainPage.xaml index b10ed42..b81695a 100644 --- a/MainPage.xaml +++ b/MainPage.xaml @@ -27,13 +27,17 @@ Text="Open Modal" Clicked="btnOpenModal_Clicked" HorizontalOptions="Fill" /> -