Skip to content

Commit

Permalink
Merge pull request #196 from edgiardina/calendar-sync
Browse files Browse the repository at this point in the history
Replace IReminderService with ICalendarStore implementation
  • Loading branch information
edgiardina authored Nov 28, 2024
2 parents 38106fc + 0af7b87 commit cd92246
Show file tree
Hide file tree
Showing 19 changed files with 130 additions and 194 deletions.
1 change: 1 addition & 0 deletions IfpaMaui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="PinballApi" Version="3.1.2" />
<PackageReference Include="Plugin.Maui.CalendarStore" Version="2.0.0" />
<PackageReference Include="Plugin.Maui.NativeCalendar" Version="0.9.0" />
<PackageReference Include="Scrutor" Version="5.0.2" />
<PackageReference Include="Serilog.Sinks.Xamarin" Version="1.0.0" />
Expand Down
13 changes: 0 additions & 13 deletions Interfaces/IReminderService.cs

This file was deleted.

44 changes: 23 additions & 21 deletions MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
using Ifpa.ViewModels;
using CommunityToolkit.Maui;
using CommunityToolkit.Maui.ApplicationModel;
using Ifpa.BackgroundJobs;
using Ifpa.Controls;
using Ifpa.Interfaces;
using Ifpa.Models;
using Microsoft.Extensions.Configuration;
using Ifpa.Views;
using Syncfusion.Maui.Core.Hosting;
using CommunityToolkit.Maui;
using Ifpa.Platforms.Renderers;
using Ifpa.Platforms.Services;
using Ifpa.Services;
using Ifpa.Interfaces;
using Ifpa.ViewModels;
using Ifpa.Views;
using MauiIcons.Fluent;
using Ifpa.BackgroundJobs;
using Shiny.Infrastructure;
using PinballApi;
using Microsoft.Extensions.Configuration;
using Microsoft.Maui.Controls.Compatibility.Hosting;
using SkiaSharp.Views.Maui.Controls.Hosting;
using PinballApi;
using Plugin.Maui.CalendarStore;
using Plugin.Maui.NativeCalendar;
using Serilog;
using Shiny;
using CommunityToolkit.Maui.ApplicationModel;
using Shiny.Infrastructure;
using SkiaSharp.Views.Maui.Controls.Hosting;
using Syncfusion.Maui.Core.Hosting;
using The49.Maui.BottomSheet;
using Ifpa.Platforms.Renderers;
using Ifpa.Platforms.Services;
using Ifpa.Controls;
using Plugin.Maui.NativeCalendar;

namespace Ifpa;

Expand Down Expand Up @@ -61,9 +62,9 @@ public static MauiApp CreateMauiApp()
{
//TODO: it's unclear whether icons must be in the Resources/Images folder or in the Platforms/{platform} folder
essentials
.AddAppAction("calendar", "Calendar", "IFPA Tournament Calendar", "calendar")
.AddAppAction("my-stats", "My Stats", "Your IFPA player data", "mystats")
.AddAppAction("rankings/player-search", "Player Search", "Search for other players in the IFPA database", "search")
.AddAppAction("calendar", Strings.AppShell_Calendar, "IFPA Tournament Calendar", "calendar")
.AddAppAction("my-stats", Strings.AppShell_MyStats, "Your IFPA player data", "mystats")
.AddAppAction("rankings/player-search", Strings.PlayerSearchPage_Title, "Search for other players in the IFPA database", "search")
.OnAppAction(App.HandleAppActions);

essentials.UseVersionTracking();
Expand Down Expand Up @@ -122,13 +123,14 @@ static MauiAppBuilder RegisterIfpaServices(this MauiAppBuilder builder)

s.AddSingleton<BlogPostService>();
s.AddSingleton<NotificationService>();
s.AddTransient<IReminderService, ReminderService>();
s.AddSingleton<IToolbarBadgeService, ToolbarBadgeService>();

s.AddSingleton(x => new PinballRankingApiV2(appSettings.IfpaApiKey));
s.AddSingleton(x => new PinballRankingApi(appSettings.IfpaApiKey));
s.AddSingleton<IGeocoding>(Geocoding.Default);
s.AddSingleton<IBadge>(Badge.Default);
s.AddSingleton(Geocoding.Default);
s.AddSingleton(Badge.Default);
s.AddSingleton(CalendarStore.Default);
s.AddSingleton(Map.Default);

return builder;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using SQLite;
using System;

namespace Ifpa.Models
namespace Ifpa.Models.Database
{
public class ActivityFeedItem
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Ifpa.Models
namespace Ifpa.Models.Database
{
public enum ActivityFeedType
{
Expand Down
3 changes: 1 addition & 2 deletions Models/Favorite.cs → Models/Database/Favorite.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using SQLite;
using System;

namespace Ifpa.Models
namespace Ifpa.Models.Database
{
public class Favorite
{
Expand Down
33 changes: 0 additions & 33 deletions Platforms/Android/ReminderService.cs

This file was deleted.

96 changes: 0 additions & 96 deletions Platforms/iOS/ReminderService.cs

This file was deleted.

2 changes: 1 addition & 1 deletion Services/LocalDatabase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Ifpa.Models;
using Ifpa.Models.Database;
using SQLite;

namespace Ifpa.Services
Expand Down
1 change: 1 addition & 0 deletions Services/NotificationService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using CommunityToolkit.Maui.ApplicationModel;
using Ifpa.Models;
using Ifpa.Models.Database;
using Microsoft.Extensions.Logging;
using PinballApi;
using PinballApi.Models.WPPR;
Expand Down
45 changes: 45 additions & 0 deletions Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,18 @@
<data name="CalendarDetailPage_SharePrompt" xml:space="preserve">
<value>Share Upcoming Tournament</value>
</data>
<data name="CalendarDetailPage_SelectCalendarPrompt" xml:space="preserve">
<value>Select which calendar to add this tournament to</value>
</data>
<data name="CalendarDetailPage_TournamentAdded" xml:space="preserve">
<value>Tournament added to your Calendar</value>
</data>
<data name="CalendarDetailPage_TournamentNotAdded" xml:space="preserve">
<value>Unable to add Tournament to your Calendar</value>
</data>
<data name="CalendarDetailPage_AddCalendarPermissionRequest" xml:space="preserve">
<value>IFPA Companion requires your permission before adding items to your Calendar</value>
</data>
<data name="CalendarDetailPage_FinalsFormat" xml:space="preserve">
<value>Finals Format</value>
</data>
Expand Down Expand Up @@ -675,4 +687,7 @@
<data name="TournamentSearchPage_Placeholder" xml:space="preserve">
<value>Search for tournaments by name</value>
</data>
<data name="PermissionRequired" xml:space="preserve">
<value>Permission Required</value>
</data>
</root>
1 change: 1 addition & 0 deletions ViewModels/ActivityFeedViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using CommunityToolkit.Mvvm.Input;
using Ifpa.Models;
using Ifpa.Models.Database;
using Ifpa.Services;
using Microsoft.Extensions.Logging;
using PinballApi;
Expand Down
Loading

0 comments on commit cd92246

Please sign in to comment.