Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aritchie committed Apr 1, 2024
1 parent 0e69a98 commit 5aaac0a
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions ProjectTemplates/ShinyApp/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Refit;
#endif
#if screenrecord
using Plugin.Maui.Audio;
using Plugin.Maui.ScreenRecording;
#endif
#if sharpnadocv
using Sharpnado.CollectionView;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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<ShinyApp.Delegates.AppActionDelegate>().Handle(y))
.OnAppAction(y => Shiny.Hosting.Host.GetService<ShinyApp.Delegates.AppActionDelegate>()!.Handle(y))
)
#endif
#if debugrainbows
Expand Down Expand Up @@ -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
Expand All @@ -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<AndroidPlatform>().CurrentActivity);
#endif
//+:cnd:noEmit
return Acr.UserDialogs.UserDialogs.Instance;
});
#endif
Expand Down

0 comments on commit 5aaac0a

Please sign in to comment.