Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/maui cinephile #698

Merged
merged 17 commits into from
Sep 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions ReactiveUI.Samples.sln
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinForms.Reactive.Client",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinForms.Reactive.Client.Tests", "winforms\demo2\WinForms.Reactive.Client.Tests\WinForms.Reactive.Client.Tests.csproj", "{51000030-6C8E-4138-ACAE-20B5B462944C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MAUI", "MAUI", "{F9D0B2A7-F4F0-4147-B64C-3D9FE244A898}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CinephileApp", "CinephileApp", "{19832957-3859-4FC3-9D41-1BD9CE005998}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cinephile", "maui\Cinephile\Cinephile\Cinephile.csproj", "{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
Expand Down Expand Up @@ -1949,6 +1955,90 @@ Global
{51000030-6C8E-4138-ACAE-20B5B462944C}.Release|x64.Build.0 = Release|Any CPU
{51000030-6C8E-4138-ACAE-20B5B462944C}.Release|x86.ActiveCfg = Release|Any CPU
{51000030-6C8E-4138-ACAE-20B5B462944C}.Release|x86.Build.0 = Release|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|Any CPU.Deploy.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|ARM.Deploy.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|ARM64.ActiveCfg = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|ARM64.Build.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|ARM64.Deploy.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|iPhone.Deploy.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|x64.Deploy.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Ad-Hoc|x86.Deploy.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|Any CPU.Build.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|Any CPU.Deploy.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|ARM.ActiveCfg = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|ARM.Build.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|ARM.Deploy.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|ARM64.ActiveCfg = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|ARM64.Build.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|ARM64.Deploy.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|iPhone.Build.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|iPhone.Deploy.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|iPhoneSimulator.Deploy.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|x64.ActiveCfg = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|x64.Build.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|x64.Deploy.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|x86.ActiveCfg = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|x86.Build.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.AppStore|x86.Deploy.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|ARM.ActiveCfg = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|ARM.Build.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|ARM.Deploy.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|ARM64.Build.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|ARM64.Deploy.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|iPhone.Build.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|iPhone.Deploy.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|x64.ActiveCfg = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|x64.Build.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|x64.Deploy.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|x86.ActiveCfg = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|x86.Build.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Debug|x86.Deploy.0 = Debug|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|Any CPU.Build.0 = Release|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|Any CPU.Deploy.0 = Release|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|ARM.ActiveCfg = Release|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|ARM.Build.0 = Release|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|ARM.Deploy.0 = Release|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|ARM64.ActiveCfg = Release|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|ARM64.Build.0 = Release|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|ARM64.Deploy.0 = Release|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|iPhone.ActiveCfg = Release|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|iPhone.Build.0 = Release|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|iPhone.Deploy.0 = Release|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|x64.ActiveCfg = Release|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|x64.Build.0 = Release|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|x64.Deploy.0 = Release|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|x86.ActiveCfg = Release|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|x86.Build.0 = Release|Any CPU
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6}.Release|x86.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1991,6 +2081,8 @@ Global
{A55476B4-70CC-4B7A-B595-0A72B45DAAAD} = {D90C288D-C775-4132-92DE-43162CA3BE72}
{6F6AD010-EE71-40E4-9D63-AFF797739DA6} = {B78B452F-A57F-4968-9FBD-365F744D131C}
{51000030-6C8E-4138-ACAE-20B5B462944C} = {B78B452F-A57F-4968-9FBD-365F744D131C}
{19832957-3859-4FC3-9D41-1BD9CE005998} = {F9D0B2A7-F4F0-4147-B64C-3D9FE244A898}
{74B16474-2B5A-4E41-98D9-A23F7DACE5B6} = {19832957-3859-4FC3-9D41-1BD9CE005998}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9CF08746-3F6B-4A63-A043-F66E12D202B0}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json;
using System.Text.Json.Serialization;

namespace Cinephile.Core.Rest.Dtos.ImageConfigurations
{
Expand All @@ -18,13 +18,13 @@ public class ImageConfigurationDto
/// <summary>
/// Gets or sets the image data.
/// </summary>
[JsonProperty(PropertyName ="images")]
[JsonPropertyName("images")]
public ImagesDto Images { get; set; }

/// <summary>
/// Gets or sets the change keys.
/// </summary>
[JsonProperty(PropertyName = "change_keys")]
[JsonPropertyName("change_keys")]
[SuppressMessage("Design", "CA2227: Change to be read-only by removing the property setter.", Justification = "Used in DTO object.")]
public IList<string> ChangeKeys { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json;
using System.Text.Json.Serialization;

namespace Cinephile.Core.Rest.Dtos.ImageConfigurations
{
Expand All @@ -19,43 +19,43 @@ public class ImagesDto
/// <summary>
/// Gets or sets the base url to the image.
/// </summary>
[JsonProperty(PropertyName = "base_url")]
[JsonPropertyName("base_url")]
public string BaseUrl { get; set; }

/// <summary>
/// Gets or sets the url to the secure image location.
/// </summary>
[JsonProperty(PropertyName = "secure_base_url")]
[JsonPropertyName("secure_base_url")]
public string SecureBaseUrl { get; set; }

/// <summary>
/// Gets or sets the backdrop sizes.
/// </summary>
[JsonProperty(PropertyName = "backdrop_sizes")]
[JsonPropertyName("backdrop_sizes")]
public IList<string> BackdropSizes { get; set; }

/// <summary>
/// Gets or sets the logo sizes.
/// </summary>
[JsonProperty(PropertyName = "logo_sizes")]
[JsonPropertyName("logo_sizes")]
public IList<string> LogoSizes { get; set; }

/// <summary>
/// Gets or sets the poster sizes.
/// </summary>
[JsonProperty(PropertyName = "poster_sizes")]
[JsonPropertyName("poster_sizes")]
public IList<string> PosterSizes { get; set; }

/// <summary>
/// Gets or sets the profile sizes.
/// </summary>
[JsonProperty(PropertyName = "profile_sizes")]
[JsonPropertyName("profile_sizes")]
public IList<string> ProfileSizes { get; set; }

/// <summary>
/// Gets or sets the still sizes.
/// </summary>
[JsonProperty(PropertyName = "still_sizes")]
[JsonPropertyName("still_sizes")]
public IList<string> StillSizes { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json;
using System.Text.Json.Serialization;

namespace Cinephile.Core.Rest.Dtos.Movies
{
Expand All @@ -18,7 +18,7 @@ public class MovieResult
/// <summary>
/// Gets or sets the poster path.
/// </summary>
[JsonProperty("poster_path")]
[JsonPropertyName("poster_path")]
public string PosterPath { get; set; }

/// <summary>
Expand All @@ -34,13 +34,13 @@ public class MovieResult
/// <summary>
/// Gets or sets the release date of the movie.
/// </summary>
[JsonProperty("release_date")]
[JsonPropertyName("release_date")]
public string ReleaseDate { get; set; }

/// <summary>
/// Gets or sets a list of genre id that are associated with the movie.
/// </summary>
[JsonProperty("genre_ids")]
[JsonPropertyName("genre_ids")]
[SuppressMessage("Design", "CA2227: Change to be read-only by removing the property setter.", Justification = "Used in DTO object.")]
public IList<int> GenreIds { get; set; }

Expand Down
14 changes: 14 additions & 0 deletions maui/Cinephile/Cinephile/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version = "1.0" encoding = "UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Cinephile"
x:Class="Cinephile.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
24 changes: 24 additions & 0 deletions maui/Cinephile/Cinephile/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
namespace Cinephile
{
public partial class App : Application
{
public App()
{
InitializeComponent();

MainPage = AppBootstrapper.CreateMainPage();
}

protected override void OnStart()
{
}

protected override void OnSleep()
{
}

protected override void OnResume()
{
}
}
}
77 changes: 77 additions & 0 deletions maui/Cinephile/Cinephile/AppBootstrapper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

using System.Diagnostics.Metrics;
using Cinephile.Core.Models;
using Cinephile.Core.Rest;
using Cinephile.ViewModels;
using Cinephile.Views;
using ReactiveUI;
using Splat;

namespace Cinephile
{
/// <summary>
/// The app bootstrapper which is used to register everything with the Splat service locator.
/// </summary>
public static class AppBootstrapper
{
/// <summary>
/// Registers everything with the Splat service locator.
/// </summary>
public static MauiAppBuilder UseAppBootstrapper(this MauiAppBuilder builder)
{
var router = new RoutingState();
var screen = new AppBootstrapScreen(router);
Locator.CurrentMutable.RegisterConstant(screen, typeof(IScreen));
Locator.CurrentMutable.Register(() => new UpcomingMoviesListView(), typeof(IViewFor<UpcomingMoviesListViewModel>));
Locator.CurrentMutable.Register(() => new UpcomingMoviesCellView(), typeof(IViewFor<UpcomingMoviesCellViewModel>));
Locator.CurrentMutable.Register(() => new MovieDetailView(), typeof(IViewFor<MovieDetailViewModel>));
Locator.CurrentMutable.Register(() => new AboutView(), typeof(IViewFor<AboutViewModel>));

Locator.CurrentMutable.Register(() => new Cache(), typeof(ICache));
Locator.CurrentMutable.Register(() => new ApiService(), typeof(IApiService));
Locator.CurrentMutable.Register(() => new MovieService(), typeof(IMovieService));

router
.NavigateAndReset
.Execute(new UpcomingMoviesListViewModel())
.Subscribe();

return builder;
}

/// <summary>
/// Creates the first main page used within the application.
/// </summary>
/// <returns>The page generated.</returns>
public static Page CreateMainPage()
{
// NB: This returns the opening page that the platform-specific
// boilerplate code will look for. It will know to find us because
// we've registered our AppBootstrapScreen.
return new ReactiveUI.Maui.RoutedViewHost();
}

/// <summary>
/// The app bootstrap screen is the central location for the RoutingState used for routing between views.
/// </summary>
private class AppBootstrapScreen : ReactiveObject, IScreen
{
/// <summary>
/// Initializes a new instance of the <see cref="AppBootstrapScreen"/> class.
/// </summary>
public AppBootstrapScreen(RoutingState router)
{
Router = router;
}

/// <summary>
/// Gets or sets the router which is used to navigate between views.
/// </summary>
public RoutingState Router { get; protected set; }
}
}
}
Loading
Loading