From a4c0fe78578d36363b1e9198e00c55dd681e29ba Mon Sep 17 00:00:00 2001 From: Ed Giardina Date: Fri, 2 Aug 2024 19:17:56 -0400 Subject: [PATCH 1/3] Use the49 bottomsheet for Calendar Detail Page --- IfpaMaui.csproj | 1 + MauiProgram.cs | 2 + Strings.Designer.cs | 4 +- Strings.resx | 4 +- Views/CalendarDetailPage.xaml | 349 ++++++++++++++++--------------- Views/CalendarDetailPage.xaml.cs | 12 +- 6 files changed, 196 insertions(+), 176 deletions(-) diff --git a/IfpaMaui.csproj b/IfpaMaui.csproj index e9d0981..eb97be9 100644 --- a/IfpaMaui.csproj +++ b/IfpaMaui.csproj @@ -77,6 +77,7 @@ + diff --git a/MauiProgram.cs b/MauiProgram.cs index 3ef6e0f..da5251b 100644 --- a/MauiProgram.cs +++ b/MauiProgram.cs @@ -16,6 +16,7 @@ using Serilog; using Shiny; using CommunityToolkit.Maui.ApplicationModel; +using The49.Maui.BottomSheet; namespace Ifpa; @@ -38,6 +39,7 @@ public static MauiApp CreateMauiApp() .UseFluentMauiIcons() .UseShiny() .UseSkiaSharp(true) + .UseBottomSheet() .ConfigureSyncfusionCore() .ConfigureFonts(fonts => { diff --git a/Strings.Designer.cs b/Strings.Designer.cs index 2484b5d..af42846 100644 --- a/Strings.Designer.cs +++ b/Strings.Designer.cs @@ -295,7 +295,7 @@ internal static string CalendarDetailPage_AddToCalendar { } /// - /// Looks up a localized string similar to Date: . + /// Looks up a localized string similar to Date. /// internal static string CalendarDetailPage_Date { get { @@ -304,7 +304,7 @@ internal static string CalendarDetailPage_Date { } /// - /// Looks up a localized string similar to Director: . + /// Looks up a localized string similar to Director. /// internal static string CalendarDetailPage_Director { get { diff --git a/Strings.resx b/Strings.resx index 3d14176..17d1984 100644 --- a/Strings.resx +++ b/Strings.resx @@ -139,7 +139,7 @@ Events Outside Country - Date: + Date Ranking Statistics @@ -265,7 +265,7 @@ Tournament Result Posted - Director: + Director My Location diff --git a/Views/CalendarDetailPage.xaml b/Views/CalendarDetailPage.xaml index 3932712..1dfc4de 100644 --- a/Views/CalendarDetailPage.xaml +++ b/Views/CalendarDetailPage.xaml @@ -10,8 +10,10 @@ xmlns:local="clr-namespace:Ifpa" xmlns:controls="clr-namespace:Ifpa.Controls" xmlns:vm="clr-namespace:Ifpa.ViewModels" + xmlns:the49="https://schemas.the49.com/dotnet/2023/maui" x:DataType="vm:CalendarDetailViewModel" - ios:Page.LargeTitleDisplay="Never"> + ios:Page.LargeTitleDisplay="Never" + x:Name="this"> 0 @@ -25,6 +27,176 @@ + + + + + + + + + + @@ -37,176 +209,13 @@ Clicked="AddToCalendarButton_Clicked" IconImageSource="{mi:Fluent Icon=CalendarAdd28, IconColor={StaticResource IconAccentColor}}" /> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + \ No newline at end of file diff --git a/Views/CalendarDetailPage.xaml.cs b/Views/CalendarDetailPage.xaml.cs index 8eaa137..ededb3e 100644 --- a/Views/CalendarDetailPage.xaml.cs +++ b/Views/CalendarDetailPage.xaml.cs @@ -1,6 +1,7 @@ using Ifpa.ViewModels; using Microsoft.Maui.Controls.Maps; using Microsoft.Maui.Maps; +using The49.Maui.BottomSheet; namespace Ifpa.Views @@ -28,10 +29,10 @@ protected override async void OnAppearing() MapSpan mapSpan = MapSpan.FromCenterAndRadius(mapLocation, Distance.FromKilometers(1)); var calendarMap = new Microsoft.Maui.Controls.Maps.Map(mapSpan) { - HeightRequest = 200, IsZoomEnabled = false, IsScrollEnabled = false, - MapType = MapType.Street + MapType = MapType.Street, + IsTrafficEnabled = false }; var pin = new Pin { @@ -52,6 +53,13 @@ protected override async void OnAppearing() catch (Exception) { } + await sheet.ShowAsync(); + } + + protected override void OnDisappearing() + { + base.OnDisappearing(); + sheet.DismissAsync(); } private void Pin_Clicked(object sender, PinClickedEventArgs e) From 98b5e86cf061d6f7a89ae0cf95bb9c7add38de3b Mon Sep 17 00:00:00 2001 From: Ed Giardina Date: Fri, 2 Aug 2024 20:26:24 -0400 Subject: [PATCH 2/3] Add android handle, padding, etc --- Platforms/Android/Resources/values/styles.xml | 4 ++++ Views/CalendarDetailPage.xaml | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 Platforms/Android/Resources/values/styles.xml diff --git a/Platforms/Android/Resources/values/styles.xml b/Platforms/Android/Resources/values/styles.xml new file mode 100644 index 0000000..389e5bb --- /dev/null +++ b/Platforms/Android/Resources/values/styles.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Views/CalendarDetailPage.xaml b/Views/CalendarDetailPage.xaml index 1dfc4de..cfbcf84 100644 --- a/Views/CalendarDetailPage.xaml +++ b/Views/CalendarDetailPage.xaml @@ -30,12 +30,14 @@ + + @@ -43,6 +45,7 @@