Skip to content

Commit

Permalink
Merge pull request #137 from FmgLib/feature/example-app
Browse files Browse the repository at this point in the history
Feature/example app
  • Loading branch information
gonultasmf authored Oct 2, 2024
2 parents c292e94 + b217dfa commit 58b7589
Show file tree
Hide file tree
Showing 226 changed files with 13,721 additions and 0 deletions.
45 changes: 45 additions & 0 deletions FmgLib.MauiMarkup.sln
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FmgLib.MauiMarkup.Generator
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyMauiMarkupApp", "sample\MyMauiMarkupApp\MyMauiMarkupApp.csproj", "{830B4B22-FECA-43A5-A445-AE439DE88762}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "F1TV", "sample\F1TV\F1TV.csproj", "{F3C0E8E0-368F-475B-A9C6-A603D8B4337B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DalluiApp", "sample\FruitApp\DalluiApp.csproj", "{C090FF97-466B-47D0-A58F-F80F0A24D893}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FruitApp", "sample\FruitApp\FruitApp.csproj", "{8C8F0E51-ADB7-4B8E-AB81-DAF6A37EDE19}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Game2048Maui", "sample\Game2048\Game2048Maui.csproj", "{B47B6A87-BDE4-4925-B5EE-A0F1B369CE93}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MatchingImage", "sample\MatchingImage\MatchingImage.csproj", "{244351D3-44F2-4C90-9B1C-3BCE7DD14172}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -61,6 +71,36 @@ Global
{830B4B22-FECA-43A5-A445-AE439DE88762}.Release|Any CPU.ActiveCfg = Release|Any CPU
{830B4B22-FECA-43A5-A445-AE439DE88762}.Release|Any CPU.Build.0 = Release|Any CPU
{830B4B22-FECA-43A5-A445-AE439DE88762}.Release|Any CPU.Deploy.0 = Release|Any CPU
{F3C0E8E0-368F-475B-A9C6-A603D8B4337B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F3C0E8E0-368F-475B-A9C6-A603D8B4337B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F3C0E8E0-368F-475B-A9C6-A603D8B4337B}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{F3C0E8E0-368F-475B-A9C6-A603D8B4337B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F3C0E8E0-368F-475B-A9C6-A603D8B4337B}.Release|Any CPU.Build.0 = Release|Any CPU
{F3C0E8E0-368F-475B-A9C6-A603D8B4337B}.Release|Any CPU.Deploy.0 = Release|Any CPU
{C090FF97-466B-47D0-A58F-F80F0A24D893}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C090FF97-466B-47D0-A58F-F80F0A24D893}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C090FF97-466B-47D0-A58F-F80F0A24D893}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{C090FF97-466B-47D0-A58F-F80F0A24D893}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C090FF97-466B-47D0-A58F-F80F0A24D893}.Release|Any CPU.Build.0 = Release|Any CPU
{C090FF97-466B-47D0-A58F-F80F0A24D893}.Release|Any CPU.Deploy.0 = Release|Any CPU
{8C8F0E51-ADB7-4B8E-AB81-DAF6A37EDE19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8C8F0E51-ADB7-4B8E-AB81-DAF6A37EDE19}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8C8F0E51-ADB7-4B8E-AB81-DAF6A37EDE19}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{8C8F0E51-ADB7-4B8E-AB81-DAF6A37EDE19}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8C8F0E51-ADB7-4B8E-AB81-DAF6A37EDE19}.Release|Any CPU.Build.0 = Release|Any CPU
{8C8F0E51-ADB7-4B8E-AB81-DAF6A37EDE19}.Release|Any CPU.Deploy.0 = Release|Any CPU
{B47B6A87-BDE4-4925-B5EE-A0F1B369CE93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B47B6A87-BDE4-4925-B5EE-A0F1B369CE93}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B47B6A87-BDE4-4925-B5EE-A0F1B369CE93}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{B47B6A87-BDE4-4925-B5EE-A0F1B369CE93}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B47B6A87-BDE4-4925-B5EE-A0F1B369CE93}.Release|Any CPU.Build.0 = Release|Any CPU
{B47B6A87-BDE4-4925-B5EE-A0F1B369CE93}.Release|Any CPU.Deploy.0 = Release|Any CPU
{244351D3-44F2-4C90-9B1C-3BCE7DD14172}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{244351D3-44F2-4C90-9B1C-3BCE7DD14172}.Debug|Any CPU.Build.0 = Debug|Any CPU
{244351D3-44F2-4C90-9B1C-3BCE7DD14172}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{244351D3-44F2-4C90-9B1C-3BCE7DD14172}.Release|Any CPU.ActiveCfg = Release|Any CPU
{244351D3-44F2-4C90-9B1C-3BCE7DD14172}.Release|Any CPU.Build.0 = Release|Any CPU
{244351D3-44F2-4C90-9B1C-3BCE7DD14172}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -72,6 +112,11 @@ Global
{A0F9BAC1-D4D6-4ADB-9CA5-F536FCA0F06D} = {9F405AEA-B646-47DD-A094-B4DA5F087273}
{DAC53472-0370-4B41-8A21-ECB0B8BD660C} = {8E033618-BADE-4A6C-AC14-56EF722D8F61}
{830B4B22-FECA-43A5-A445-AE439DE88762} = {A4956394-4BE4-4C5A-BDD3-59F439A1FD98}
{F3C0E8E0-368F-475B-A9C6-A603D8B4337B} = {A4956394-4BE4-4C5A-BDD3-59F439A1FD98}
{C090FF97-466B-47D0-A58F-F80F0A24D893} = {A4956394-4BE4-4C5A-BDD3-59F439A1FD98}
{8C8F0E51-ADB7-4B8E-AB81-DAF6A37EDE19} = {A4956394-4BE4-4C5A-BDD3-59F439A1FD98}
{B47B6A87-BDE4-4925-B5EE-A0F1B369CE93} = {A4956394-4BE4-4C5A-BDD3-59F439A1FD98}
{244351D3-44F2-4C90-9B1C-3BCE7DD14172} = {A4956394-4BE4-4C5A-BDD3-59F439A1FD98}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2698E1E7-D253-457B-AF1B-6754123E0A11}
Expand Down
11 changes: 11 additions & 0 deletions sample/DalluiApp/App.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace DalluiApp;

public partial class App : Application
{
public App()
{
this
.Resources(AppStyles.Default)
.MainPage(new AppShell());
}
}
28 changes: 28 additions & 0 deletions sample/DalluiApp/AppShell.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
namespace DalluiApp
{
public partial class AppShell : Shell
{
public AppShell()
{
this
.FlyoutBehavior(FlyoutBehavior.Disabled)
.ShellNavBarIsVisible(false)
.Items(
new ShellContent()
.Title("DashboardView")
.ContentTemplate(() => new DashboardView())
.Route(nameof(DashboardView)),

new ShellContent()
.Title("GenerationOptionsView")
.ContentTemplate(() => new GenerationOptionsView())
.Route(nameof(GenerationOptionsView)),

new ShellContent()
.Title("ImageGeneratorView")
.ContentTemplate(() => new ImageGeneratorView())
.Route(nameof(ImageGeneratorView))
);
}
}
}
93 changes: 93 additions & 0 deletions sample/DalluiApp/DalluiApp.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->

<!-- Note for MacCatalyst:
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->

<OutputType>Exe</OutputType>
<RootNamespace>DalluiApp</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<!-- Display name -->
<ApplicationTitle>DalluiApp</ApplicationTitle>

<!-- App Identifier -->
<ApplicationId>com.companyname.dalluiapp</ApplicationId>
<ApplicationIdGuid>e381223c-e318-401a-bd08-b5b071d0cec3</ApplicationIdGuid>

<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
<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>

<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />

<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<MauiImage Update="Resources\Images\dotnet_bot.png" Resize="True" BaseSize="300,185" />

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

<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<None Remove="Resources\Fonts\Nexa-ExtraLight.ttf" />
<None Remove="Resources\Fonts\Nexa-Heavy.ttf" />
<None Remove="Resources\Images\anime.jpg" />
<None Remove="Resources\Images\cartoon.jpg" />
<None Remove="Resources\Images\dashboard1.jpg" />
<None Remove="Resources\Images\dashboard2.jpg" />
<None Remove="Resources\Images\dashboard3.jpg" />
<None Remove="Resources\Images\funko.jpg" />
<None Remove="Resources\Images\isometric.jpg" />
<None Remove="Resources\Images\minimalism.jpg" />
<None Remove="Resources\Images\popart.jpg" />
<None Remove="Resources\Images\profile1.jpg" />
<None Remove="Resources\Images\profile2.jpg" />
<None Remove="Resources\Images\profile3.jpg" />
<None Remove="Resources\Images\profilesquare.jpg" />
<None Remove="Resources\Images\realistic.jpg" />
<None Remove="Resources\Images\storybook.jpg" />
<None Remove="Resources\Images\surrealism.jpg" />
<None Remove="Resources\Images\watercolor.jpg" />
<None Remove="Resources\Raw\robot.json" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="CardsView.Maui" Version="0.0.9" />
<PackageReference Include="CommunityToolkit.Maui" Version="9.0.2" />
<PackageReference Include="FmgLib.MauiMarkup" Version="8.8.3" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.70" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.70" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="SkiaSharp.Extended.UI.Maui" Version="3.0.0-preview.7" />
</ItemGroup>

</Project>
19 changes: 19 additions & 0 deletions sample/DalluiApp/Imports.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
global using DalluiApp;
global using DalluiApp.Views;
global using DalluiApp.Models;

global using PanCardView;
global using PanCardView.Processors;
global using CommunityToolkit.Maui;
global using CommunityToolkit.Maui.Converters;
global using Microsoft.Maui.Controls.Shapes;
global using SkiaSharp.Views.Maui.Controls.Hosting;
global using SkiaSharp.Extended.UI.Controls;

// Markup FmgLib
global using FmgLib.MauiMarkup;
global using static Microsoft.Maui.Controls.FontAttributes;
global using static Microsoft.Maui.Controls.LayoutAlignment;
// Static
global using static Microsoft.Maui.Graphics.Colors;
global using Microsoft.Maui.Controls;
35 changes: 35 additions & 0 deletions sample/DalluiApp/MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using Microsoft.Extensions.Logging;

namespace DalluiApp;

[MauiMarkup(typeof(CoverFlowView), typeof(CardsView), typeof(SKLottieView), typeof(SKAnimatedSurfaceView), typeof(SKFileLottieImageSource))]
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseCardsView()
.UseSkiaSharp()
.UseMauiCommunityToolkit()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
fonts.AddFont("Nexa-ExtraLight.ttf", "NexaLight");
fonts.AddFont("Nexa-Heavy.ttf", "NexaHeavy");
});

builder.Logging.AddDebug();

builder.Services
.AddSingleton<App>()
.AddSingleton<AppShell>()
.AddScoped<DashboardView>()
.AddScoped<GenerationOptionsView>()
.AddScoped<ImageGeneratorView>();

return builder.Build();
}
}
7 changes: 7 additions & 0 deletions sample/DalluiApp/Models/ArtStyle.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace DalluiApp.Models;

public class ArtStyle
{
public string Name { get; set; }
public string ImageUrl { get; set; }
}
8 changes: 8 additions & 0 deletions sample/DalluiApp/Models/GeneratedImage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace DalluiApp.Models;

public class GeneratedImage
{
public string ImagePath { get; set; }
public string MainKeyword { get; set; }
public List<string> Keywords { get; set; }
}
14 changes: 14 additions & 0 deletions sample/DalluiApp/Models/Profile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DalluiApp.Models;

public class Profile
{
public string ProfileImage { get; set; }
public string Name { get; set; }
public int NoPhotos { get; set; }
}
6 changes: 6 additions & 0 deletions sample/DalluiApp/Platforms/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
11 changes: 11 additions & 0 deletions sample/DalluiApp/Platforms/Android/MainActivity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Android.App;
using Android.Content.PM;
using Android.OS;

namespace DalluiApp
{
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity
{
}
}
16 changes: 16 additions & 0 deletions sample/DalluiApp/Platforms/Android/MainApplication.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Android.App;
using Android.Runtime;

namespace DalluiApp
{
[Application]
public class MainApplication : MauiApplication
{
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
: base(handle, ownership)
{
}

protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#512BD4</color>
<color name="colorPrimaryDark">#2B0B98</color>
<color name="colorAccent">#2B0B98</color>
</resources>
10 changes: 10 additions & 0 deletions sample/DalluiApp/Platforms/MacCatalyst/AppDelegate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Foundation;

namespace DalluiApp
{
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
}
14 changes: 14 additions & 0 deletions sample/DalluiApp/Platforms/MacCatalyst/Entitlements.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!-- See https://aka.ms/maui-publish-app-store#add-entitlements for more information about adding entitlements.-->
<dict>
<!-- App Sandbox must be enabled to distribute a MacCatalyst app through the Mac App Store. -->
<key>com.apple.security.app-sandbox</key>
<true/>
<!-- When App Sandbox is enabled, this value is required to open outgoing network connections. -->
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>

38 changes: 38 additions & 0 deletions sample/DalluiApp/Platforms/MacCatalyst/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- The Mac App Store requires you specify if the app uses encryption. -->
<!-- Please consult https://developer.apple.com/documentation/bundleresources/information_property_list/itsappusesnonexemptencryption -->
<!-- <key>ITSAppUsesNonExemptEncryption</key> -->
<!-- Please indicate <true/> or <false/> here. -->

<!-- Specify the category for your app here. -->
<!-- Please consult https://developer.apple.com/documentation/bundleresources/information_property_list/lsapplicationcategorytype -->
<!-- <key>LSApplicationCategoryType</key> -->
<!-- <string>public.app-category.YOUR-CATEGORY-HERE</string> -->
<key>UIDeviceFamily</key>
<array>
<integer>2</integer>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/appicon.appiconset</string>
</dict>
</plist>
Loading

0 comments on commit 58b7589

Please sign in to comment.