diff --git a/ProjectTemplates/ShinyApp/.template.config/ide.host.json b/ProjectTemplates/ShinyApp/.template.config/ide.host.json index a5258c2..27a899f 100644 --- a/ProjectTemplates/ShinyApp/.template.config/ide.host.json +++ b/ProjectTemplates/ShinyApp/.template.config/ide.host.json @@ -305,6 +305,18 @@ "text": "Add Screen Recording (Plugin.Maui.ScreenRecording)" }, "isVisible": true + },{ + "id": "userdialogs", + "name":{ + "text": "Add ACR User Dialogs (Acr.UserDialogs)" + }, + "isVisible": true + },{ + "id": "debugrainbows", + "name":{ + "text": "Add Debug Rainbows (Plugin.Maui.DebugRainbows)" + }, + "isVisible": true },{ "id": "ffimageloading", "name":{ diff --git a/ProjectTemplates/ShinyApp/.template.config/template.json b/ProjectTemplates/ShinyApp/.template.config/template.json index 3a77ebf..48977d1 100644 --- a/ProjectTemplates/ShinyApp/.template.config/template.json +++ b/ProjectTemplates/ShinyApp/.template.config/template.json @@ -449,6 +449,20 @@ "description": "Add SkiaSharp Extended (Lottie) - Documentation: https://github.com/mono/SkiaSharp.Extended", "displayName": "Add SkiaSharp Extended (Lottie)" }, + "userdialogs": { + "type": "parameter", + "datatype": "bool", + "defaultValue": "false", + "description": "Add ACR User Dialogs - Documentation: https://github.com/aritchie/userdialogs", + "displayName": "Add ACR User Dialogs" + }, + "debugrainbows": { + "type": "parameter", + "datatype": "bool", + "defaultValue": "false", + "description": "Add Debug Rainbows - Documentation: https://github.com/sthewissen/Plugin.Maui.DebugRainbows", + "displayName": "Add Debug Rainbows" + }, "ffimageloading":{ "type": "parameter", "datatype": "bool", diff --git a/ProjectTemplates/ShinyApp/Documentation.md b/ProjectTemplates/ShinyApp/Documentation.md index ab65944..5db54ca 100644 --- a/ProjectTemplates/ShinyApp/Documentation.md +++ b/ProjectTemplates/ShinyApp/Documentation.md @@ -320,4 +320,20 @@ A set of 70+ free and open source native Blazor UI controls * [Documentation](https://blazor.radzen.com/)] * [GitHub](https://github.com/radzenhq/radzen-blazor) + + +## ACR User Dialogs + +_A cross platform library that allows you to call for standard user dialogs from a shared/portable library that supports Android & iOS by Allan Ritchie_ + +* [GitHub](https://github.com/aritchie/userdialogs) + + + +## Debug Rainbow + +_Have you ever had a piece of XAML code that didn't produce the layout you expected? Did you change the background colors on certain elements to get an idea of where they are positioned? Admit it, you have and pretty much all of us have at some point. Either way, this is the package for you! It adds some nice colorful debug modes to your ContentPages or specific visual elements that let you immediately see where all of your elements are located! by Steven Thewissen_ + +[GitHub](https://github.com/sthewissen/Plugin.Maui.DebugRainbows) + \ No newline at end of file diff --git a/ProjectTemplates/ShinyApp/MauiProgram.cs b/ProjectTemplates/ShinyApp/MauiProgram.cs index 44c0f90..dda4802 100644 --- a/ProjectTemplates/ShinyApp/MauiProgram.cs +++ b/ProjectTemplates/ShinyApp/MauiProgram.cs @@ -1,27 +1,15 @@ -#if inappbilling -using Plugin.InAppBilling; -#endif -#if storereview -using Plugin.StoreReview; +#if debugrainbows +using Plugin.Maui.DebugRainbows; #endif #if barcodes using ZXing.Net.Maui.Controls; #endif -#if calendar -using Plugin.Maui.CalendarStore; -#endif -#if audio -using Plugin.Maui.Audio; -#endif -#if screenrecord -using Plugin.Maui.ScreenRecording; -#endif -#if fingerprint -using Plugin.Fingerprint; -#endif #if usehttp using Refit; #endif +#if screenrecord +using Plugin.Maui.Audio; +#endif #if sharpnadocv using Sharpnado.CollectionView; #endif @@ -68,9 +56,6 @@ public static MauiApp CreateMauiApp() => MauiApp .UseUraniumUIMaterial() .UseUraniumUIBlurs() #endif -#if screenrecord - .UseScreenRecording() -#endif #if shinyframework || communitytoolkit .UseMauiCommunityToolkit() #endif @@ -86,6 +71,15 @@ 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 @@ -146,6 +140,24 @@ public static MauiApp CreateMauiApp() => MauiApp // .AddAppAction("battery_info", "Battery Info") .OnAppAction(y => Shiny.Hosting.Host.GetService().Handle(y)) ) +#endif +#if debugrainbows +//-:cnd:noEmit +#if DEBUG + .UseDebugRainbows( + // new DebugRainbowOptions{ + // ShowRainbows = true, + // ShowGrid = true, + // HorizontalItemSize = 20, + // VerticalItemSize = 20, + // MajorGridLineInterval = 4, + // MajorGridLines = new GridLineOptions { Color = Color.FromRgb(255, 0, 0), Opacity = 1, Width = 4 }, + // MinorGridLines = new GridLineOptions { Color = Color.FromRgb(255, 0, 0), Opacity = 1, Width = 1 }, + // GridOrigin = DebugGridOrigin.TopLeft, + // } + ) +#endif +//+:cnd:noEmit #endif .ConfigureFonts(fonts => { @@ -190,15 +202,6 @@ static MauiAppBuilder RegisterInfrastructure(this MauiAppBuilder builder) #endif //+:cnd:noEmit var s = builder.Services; -#if (audio) - s.AddSingleton(AudioManager.Current); -#endif -#if (calendar) - s.AddSingleton(CalendarStore.Default); -#endif -#if (screenrecord) - s.AddSingleton(ScreenRecording.Default); -#endif #if appaction s.AddSingleton(); #endif @@ -236,23 +239,6 @@ static MauiAppBuilder RegisterInfrastructure(this MauiAppBuilder builder) #if essentialsfilepicker s.AddSingleton(FilePicker.Default); #endif -#if inappbilling - s.AddSingleton(CrossInAppBilling.Current); -#endif -#if storereview - s.AddSingleton(CrossStoreReview.Current); -#endif -#if fingerprint - s.AddSingleton(sp => - { -//-:cnd:noEmit -#if ANDROID - CrossFingerprint.SetCurrentActivityResolver(() => sp.GetRequiredService().CurrentActivity); -#endif -//+:cnd:noEmit - return CrossFingerprint.Current; - }); -#endif #if startup s.AddShinyService(); #endif @@ -294,9 +280,6 @@ static MauiAppBuilder RegisterInfrastructure(this MauiAppBuilder builder) #if notifications s.AddNotifications(); #endif -#if speechrecognition - s.AddSpeechRecognition(); -#endif #if usepushnative s.AddPush(); #endif @@ -310,12 +293,43 @@ static MauiAppBuilder RegisterInfrastructure(this MauiAppBuilder builder) #if usepushfirebase s.AddPushFirebaseMessaging(); #endif -#if health +#if speechrecognition + s.AddSingleton(CommunityToolkit.Maui.Media.SpeechToText.Default); +#endif +#if (audio) +#if screenrecord + builder.UseScreenRecording(); + s.AddSingleton(AudioManager.Current); +#endif +#if (calendar) + s.AddSingleton(Plugin.Maui.CalendarStore.CalendarStore.Default); +#endif +#if (screenrecord) + s.AddSingleton(Plugin.Maui.ScreenRecording.ScreenRecording.Default); +#endif +#if inappbilling + s.AddSingleton(Plugin.InAppBilling.CrossInAppBilling.Current); +#endif +#if storereview + s.AddSingleton(Plugin.StoreReview.CrossStoreReview.Current); +#endif +#if fingerprint + s.AddSingleton(sp => + { //-:cnd:noEmit -#if !MACCATALYST - s.AddHealthIntegration(); +#if ANDROID + Plugin.Fingerprint.CrossFingerprint.SetCurrentActivityResolver(() => sp.GetRequiredService().CurrentActivity); #endif //+:cnd:noEmit + return Plugin.Fingerprint.CrossFingerprint.Current; + }); +#endif +#if userdialogs + s.AddSingleton(sp => + { + Acr.UserDialogs.UserDialogs.Init(() => sp.GetRequiredService().CurrentActivity); + return Acr.UserDialogs.UserDialogs.Instance; + }); #endif #if shinyframework s.AddDataAnnotationValidation(); diff --git a/ProjectTemplates/ShinyApp/ShinyApp.csproj b/ProjectTemplates/ShinyApp/ShinyApp.csproj index 5b1bded..80cba52 100644 --- a/ProjectTemplates/ShinyApp/ShinyApp.csproj +++ b/ProjectTemplates/ShinyApp/ShinyApp.csproj @@ -163,7 +163,7 @@ - + @@ -171,7 +171,7 @@ - + @@ -252,9 +252,9 @@ - - - + + + @@ -265,6 +265,12 @@ + + + + + + @@ -276,7 +282,7 @@ - + diff --git a/Template.csproj b/Template.csproj index b622c40..e07ed09 100644 --- a/Template.csproj +++ b/Template.csproj @@ -3,7 +3,7 @@ Shiny.NET Templates - One stop shop to setup almost everything you can imagine within your .NET MAUI application Template - 2.4.3 + 2.4.4 Shiny.Templates Shiny Templates Allan Ritchie