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

Update QuickJournal #3401

Merged
merged 7 commits into from
Aug 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
2 changes: 1 addition & 1 deletion examples/QuickJournal/AppShell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ShellContent
Title="QuickJournal"
ContentTemplate="{DataTemplate local:JournalEntriesPage}"
ContentTemplate="{DataTemplate local:EntriesPage}"
Route="main" />

</Shell>
Expand Down
5 changes: 2 additions & 3 deletions examples/QuickJournal/AppShell.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ public AppShell()
{
InitializeComponent();

Routing.RegisterRoute("entryDetail", typeof(JournalEntryDetailPage));
Routing.RegisterRoute("entryDetail", typeof(EntryDetailPage));
}
}

}
10 changes: 2 additions & 8 deletions examples/QuickJournal/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,12 @@ public static MauiApp CreateMauiApp()
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseMauiCommunityToolkit()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
.UseMauiCommunityToolkit();

#if DEBUG
builder.Logging.AddDebug();
#endif

return builder.Build();
}
}

}
3 changes: 1 addition & 2 deletions examples/QuickJournal/Models/EntryMetadata.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using Realms;
using Realms;

namespace QuickJournal.Models
{
Expand Down
9 changes: 4 additions & 5 deletions examples/QuickJournal/Models/JournalEntry.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
using System;
using Realms;
using Realms;

namespace QuickJournal.Models
{
public partial class JournalEntry : IRealmObject
{
public string Title { get; set; }
public string? Title { get; set; }

public string Body { get; set; }
public string? Body { get; set; }

public EntryMetadata Metadata { get; set; }
public EntryMetadata? Metadata { get; set; }
}
}
3 changes: 1 addition & 2 deletions examples/QuickJournal/Platforms/Android/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ namespace QuickJournal;
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity
{
}

}
3 changes: 1 addition & 2 deletions examples/QuickJournal/Platforms/Android/MainApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ public MainApplication(IntPtr handle, JniHandleOwnership ownership)
}

protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}

}
3 changes: 1 addition & 2 deletions examples/QuickJournal/Platforms/MacCatalyst/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ namespace QuickJournal;
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}

}
5 changes: 2 additions & 3 deletions examples/QuickJournal/Platforms/MacCatalyst/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ namespace QuickJournal;
public class Program
{
// This is the main entry point of the application.
static void Main(string[] args)
public static void Main(string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main(args, null, typeof(AppDelegate));
}
}

}
3 changes: 1 addition & 2 deletions examples/QuickJournal/Platforms/iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ namespace QuickJournal;
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}

}
5 changes: 2 additions & 3 deletions examples/QuickJournal/Platforms/iOS/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ namespace QuickJournal;
public class Program
{
// This is the main entry point of the application.
static void Main(string[] args)
public static void Main(string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main(args, null, typeof(AppDelegate));
}
}

}
27 changes: 13 additions & 14 deletions examples/QuickJournal/QuickJournal.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<CodeAnalysisRuleSet>stylecop.ruleset</CodeAnalysisRuleSet>
<Nullable>enable</Nullable>
<WindowsPackageType>None</WindowsPackageType>

<!-- Display name -->
<ApplicationTitle>QuickJournal</ApplicationTitle>
Expand All @@ -25,35 +28,31 @@
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-ios|AnyCPU'">
<CreatePackage>false</CreatePackage>
</PropertyGroup>
<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />

<MauiIcon Include="Resources\AppIcon\appicon.png" Color="#00684A" />
<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<MauiFont Include="Resources\Fonts\*" />

<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
<MauiSplashScreen Include="Resources\Splash\mongodb.png" Color="#00684A" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="Realm" Version="10.19.0" />
<PackageReference Include="CommunityToolkit.Maui" Version="3.1.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.0.0" />
<PackageReference Include="CommunityToolkit.Maui" Version="5.2.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
<PackageReference Include="Realm" Version="11.3.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<AdditionalFiles Include="stylecop.json" />
<None Remove="Realm" />
<None Remove="CommunityToolkit.Maui" />
<None Remove="CommunityToolkit.Mvvm" />
Expand Down
9 changes: 8 additions & 1 deletion examples/QuickJournal/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# QuickJournal

**QuickJournal** is a simple MAUI application that shows how Realm can be used effectively in conjunction with MVVM and data binding.
The app allows the user to keep a very minimal journal, where each entry is made up of a title and a body. Every time a new journal entry is added or modified it gets persisted to a realm, and thanks to the bindings the UI gets updated immediately, with no additional code required.
The app allows the user to keep a very minimal journal, where each entry is made up of a title and a body. Every time a new journal entry is added or modified it gets persisted to a realm, and thanks to the bindings the UI gets updated immediately, with no additional code required.

---
**NOTE**

Due to a [bug in MAUI](https://github.com/dotnet/maui/issues/14065), the rows of the `ListView` on `EntriesPage` don't appear on Windows, even though they are still clickable.

---
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 0 additions & 5 deletions examples/QuickJournal/Resources/AppIcon/appicon.svg

This file was deleted.

8 changes: 0 additions & 8 deletions examples/QuickJournal/Resources/AppIcon/appiconfg.svg

This file was deleted.

Binary file not shown.
Binary file not shown.
Loading
Loading