Skip to content

Commit

Permalink
Update sample project
Browse files Browse the repository at this point in the history
  • Loading branch information
yiszza committed Dec 2, 2023
1 parent 15b1cff commit d9db69f
Show file tree
Hide file tree
Showing 6 changed files with 158 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -366,5 +366,4 @@ yarn.lock
node_modules
package.json
.vitepress
/Sample/**
/.gitignore
39 changes: 39 additions & 0 deletions Sample/Dialog.xaml
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8" ?>
<md:Popup
x:Class="Sample.Dialog"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:md="clr-namespace:Material.Components.Maui;assembly=Material.Components.Maui">

<md:Card
BackgroundColor="{DynamicResource SurfaceColor}"
Shape="28"
WidthRequest="350">
<Grid Padding="24" RowDefinitions="auto,auto,auto">
<Label
FontSize="24"
HorizontalOptions="Center"
Text="Base dialog title" />
<Label
Grid.Row="1"
Padding="0,24,0,16"
Text="A dialog is a type of modal window that appears in front of app content to provide critical information, or ask for a decision."
TextColor="{DynamicResource OnSurfaceVariantColor}" />
<HorizontalStackLayout
Grid.Row="2"
HorizontalOptions="End"
Spacing="8">
<md:Button
x:Name="Cancel"
FontWeight="Medium"
Style="{DynamicResource TextButtonStyle}"
Text="Cancel" />
<md:Button
x:Name="Confirm"
FontWeight="Medium"
Style="{DynamicResource TextButtonStyle}"
Text="Confirm" />
</HorizontalStackLayout>
</Grid>
</md:Card>
</md:Popup>
11 changes: 11 additions & 0 deletions Sample/Dialog.xaml.cs
@@ -0,0 +1,11 @@
using Material.Components.Maui;

namespace Sample;

public partial class Dialog : Popup
{
public Dialog()
{
this.InitializeComponent();
}
}
11 changes: 11 additions & 0 deletions Sample/Platforms/MacCatalyst/Entitlements.Debug.plist
@@ -0,0 +1,11 @@
<?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>
<!-- Enable this value to use browser developer tools while debugging.-->
<!-- See https://aka.ms/blazor-hybrid-developer-tools -->
<key>com.apple.security.get-task-allow</key>
<true/>
</dict>
</plist>

12 changes: 12 additions & 0 deletions Sample/Platforms/MacCatalyst/Entitlements.Release.plist
@@ -0,0 +1,12 @@
<?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>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>

85 changes: 85 additions & 0 deletions Sample/Sample.csproj
@@ -0,0 +1,85 @@
<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 <RuntimeIdentifer>.
The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
<!-- ex. <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->

<OutputType>Exe</OutputType>
<RootNamespace>Sample</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>

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

<!-- App Identifier -->
<ApplicationId>com.companyname.sample</ApplicationId>

<!-- 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.svg" BaseSize="168,208" />

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

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

<ItemGroup>
<PackageReference Include="IconPacks.Material" Version="1.0.8732.5-build" />
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0-preview.6.23329.7" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\src\Material.Components.Maui\Material.Components.Maui.csproj" />
</ItemGroup>

<ItemGroup>
<MauiXaml Update="Dialog.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
</ItemGroup>

<!-- Build Properties must be defined within these property groups to ensure successful publishing
to the Mac App Store. See: https://aka.ms/maui-publish-app-store#define-build-properties-in-your-project-file -->
<PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Debug'">
<CodesignEntitlements>Platforms/MacCatalyst/Entitlements.Debug.plist</CodesignEntitlements>
</PropertyGroup>

<PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Release'">
<CodesignEntitlements>Platforms/MacCatalyst/Entitlements.Release.plist</CodesignEntitlements>
<UseHardenedRuntime>true</UseHardenedRuntime>
</PropertyGroup>
</Project>

0 comments on commit d9db69f

Please sign in to comment.