From 5aaac0a6492db939e349ad48397e0fdd050a2b5a Mon Sep 17 00:00:00 2001 From: Allan Ritchie Date: Mon, 1 Apr 2024 18:40:50 -0400 Subject: [PATCH] Fixes --- ProjectTemplates/ShinyApp/MauiProgram.cs | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/ProjectTemplates/ShinyApp/MauiProgram.cs b/ProjectTemplates/ShinyApp/MauiProgram.cs index dda4802..9ea2342 100644 --- a/ProjectTemplates/ShinyApp/MauiProgram.cs +++ b/ProjectTemplates/ShinyApp/MauiProgram.cs @@ -8,7 +8,7 @@ using Refit; #endif #if screenrecord -using Plugin.Maui.Audio; +using Plugin.Maui.ScreenRecording; #endif #if sharpnadocv using Sharpnado.CollectionView; @@ -71,15 +71,6 @@ public static MauiApp CreateMauiApp() => MauiApp #if sharpnadocv .UseSharpnadoCollectionView(false) #endif -#if (userdialogs) - .ConfigureLifecycleEvents(events => - { -//-:cnd:noEmit -#if ANDROID - events.AddAndroid(android => android.OnApplicationCreate(app => Acr.UserDialogs.UserDialogs.Init(app))); -#endif -//+:cnd:noEmit - }) #if ffimageloading .UseFFImageLoading() #endif @@ -138,7 +129,7 @@ public static MauiApp CreateMauiApp() => MauiApp .ConfigureEssentials(x => x // .AddAppAction("app_info", "App Info", "Subtitle", "app_info_action_icon") // .AddAppAction("battery_info", "Battery Info") - .OnAppAction(y => Shiny.Hosting.Host.GetService().Handle(y)) + .OnAppAction(y => Shiny.Hosting.Host.GetService()!.Handle(y)) ) #endif #if debugrainbows @@ -298,13 +289,13 @@ static MauiAppBuilder RegisterInfrastructure(this MauiAppBuilder builder) #endif #if (audio) #if screenrecord - builder.UseScreenRecording(); - s.AddSingleton(AudioManager.Current); + s.AddSingleton(Plugin.Maui.AudioManager.Current); #endif #if (calendar) s.AddSingleton(Plugin.Maui.CalendarStore.CalendarStore.Default); #endif #if (screenrecord) + builder.UseScreenRecording(); s.AddSingleton(Plugin.Maui.ScreenRecording.ScreenRecording.Default); #endif #if inappbilling @@ -327,7 +318,11 @@ static MauiAppBuilder RegisterInfrastructure(this MauiAppBuilder builder) #if userdialogs s.AddSingleton(sp => { +//-:cnd:noEmit +#if ANDROID Acr.UserDialogs.UserDialogs.Init(() => sp.GetRequiredService().CurrentActivity); +#endif +//+:cnd:noEmit return Acr.UserDialogs.UserDialogs.Instance; }); #endif