Skip to content

Commit aab4828

Browse files
authored
Merge pull request #590 from unoplatform/dev/shwe/tp-app
Sample app
2 parents b7633e6 + e7ab848 commit aab4828

File tree

79 files changed

+3774
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+3774
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<Project>
2+
3+
<!--
4+
If working on a single target framework, open solution-config.props and uncomment the
5+
appropriate lines in solution-config.props to build for the desired platforms only.
6+
7+
https://platform.uno/docs/articles/guides/solution-building-single-targetframework.html
8+
-->
9+
<Import Project="solution-config.props" Condition="exists('solution-config.props')" />
10+
11+
12+
<PropertyGroup>
13+
<ImplicitUsings>enable</ImplicitUsings>
14+
<Nullable>enable</Nullable>
15+
16+
<DebugType>portable</DebugType>
17+
<DebugSymbols>True</DebugSymbols>
18+
19+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
20+
21+
<!--
22+
Adding NoWarn to remove build warnings
23+
NU1507: Warning when there are multiple package sources when using CPM with no source mapping
24+
NETSDK1201: Warning that specifying RID won't create self containing app
25+
PRI257: Ignore default language (en) not being one of the included resources (eg en-us, en-uk)
26+
-->
27+
<NoWarn>$(NoWarn);NU1507;NETSDK1201;PRI257</NoWarn>
28+
29+
<DefaultLanguage>en</DefaultLanguage>
30+
31+
<IsAndroid>false</IsAndroid>
32+
<IsIOS>false</IsIOS>
33+
<IsMac>false</IsMac>
34+
<IsMacCatalyst>false</IsMacCatalyst>
35+
<IsWinAppSdk>false</IsWinAppSdk>
36+
</PropertyGroup>
37+
38+
<Choose>
39+
<When Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
40+
<PropertyGroup>
41+
<IsAndroid>true</IsAndroid>
42+
<SupportedOSPlatformVersion>21.0</SupportedOSPlatformVersion>
43+
</PropertyGroup>
44+
</When>
45+
<When Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">
46+
<PropertyGroup>
47+
<IsIOS>true</IsIOS>
48+
<SupportedOSPlatformVersion>14.2</SupportedOSPlatformVersion>
49+
</PropertyGroup>
50+
</When>
51+
<When Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'macos'">
52+
<PropertyGroup>
53+
<IsMac>true</IsMac>
54+
<SupportedOSPlatformVersion>10.14</SupportedOSPlatformVersion>
55+
</PropertyGroup>
56+
</When>
57+
<When Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
58+
<PropertyGroup>
59+
<IsMacCatalyst>true</IsMacCatalyst>
60+
<SupportedOSPlatformVersion>14.0</SupportedOSPlatformVersion>
61+
</PropertyGroup>
62+
</When>
63+
<When Condition="$(TargetFramework.Contains('windows10'))">
64+
<PropertyGroup>
65+
<IsWinAppSdk>true</IsWinAppSdk>
66+
<SupportedOSPlatformVersion>10.0.18362.0</SupportedOSPlatformVersion>
67+
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
68+
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
69+
<EnableCoreMrtTooling Condition=" '$(BuildingInsideVisualStudio)' != 'true' ">false</EnableCoreMrtTooling>
70+
</PropertyGroup>
71+
</When>
72+
</Choose>
73+
74+
</Project>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<Project>
2+
<ItemGroup>
3+
<!-- Removes native usings to avoid Ambiguous reference -->
4+
<Using Remove="@(Using->HasMetadata('Platform'))" />
5+
</ItemGroup>
6+
</Project>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<Project ToolsVersion="15.0">
2+
<ItemGroup>
3+
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
4+
<PackageVersion Include="Microsoft.Windows.Compatibility" Version="7.0.4" />
5+
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.756" />
6+
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.4.231008000" />
7+
<PackageVersion Include="SkiaSharp.Skottie" Version="2.88.6" />
8+
<PackageVersion Include="SkiaSharp.Views.Uno.WinUI" Version="2.88.6" />
9+
<PackageVersion Include="Uno.Core.Extensions.Logging.Singleton" Version="4.0.1" />
10+
<PackageVersion Include="Uno.Extensions.Configuration" Version="3.0.8" />
11+
<PackageVersion Include="Uno.Extensions.Hosting" Version="3.0.8" />
12+
<PackageVersion Include="Uno.Extensions.Hosting.WinUI" Version="3.0.8" />
13+
<PackageVersion Include="Uno.Extensions.Http.Refit" Version="3.0.8" />
14+
<PackageVersion Include="Uno.Extensions.Http.WinUI" Version="3.0.8" />
15+
<PackageVersion Include="Uno.Extensions.Logging.OSLog" Version="1.7.0" />
16+
<PackageVersion Include="Uno.Extensions.Logging.WebAssembly.Console" Version="1.7.0" />
17+
<PackageVersion Include="Uno.Extensions.Navigation" Version="3.0.8" />
18+
<PackageVersion Include="Uno.Extensions.Navigation.WinUI" Version="3.0.8" />
19+
<PackageVersion Include="Uno.Extensions.Navigation.Toolkit.WinUI" Version="3.0.8" />
20+
<PackageVersion Include="Uno.Extensions.Reactive" Version="3.0.8" />
21+
<PackageVersion Include="Uno.Extensions.Reactive.WinUI" Version="3.0.8" />
22+
<PackageVersion Include="Uno.Material.WinUI" Version="4.0.2" />
23+
<PackageVersion Include="Uno.Dsp.Tasks" Version="1.2.4" />
24+
<PackageVersion Include="Uno.Toolkit.WinUI" Version="5.0.11" />
25+
<PackageVersion Include="Uno.Toolkit.WinUI.Material" Version="5.0.11" />
26+
<PackageVersion Include="Uno.Resizetizer" Version="1.2.0" />
27+
<PackageVersion Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="5.0.17" />
28+
<PackageVersion Include="Uno.UniversalImageLoader" Version="1.9.36" />
29+
<PackageVersion Include="Uno.Wasm.Bootstrap" Version="7.0.31" />
30+
<PackageVersion Include="Uno.Wasm.Bootstrap.DevServer" Version="7.0.31" />
31+
<PackageVersion Include="Uno.Wasm.Bootstrap.Server" Version="7.0.31" />
32+
<PackageVersion Include="Uno.WinUI" Version="5.0.17" />
33+
<PackageVersion Include="Uno.WinUI.Lottie" Version="5.0.17" />
34+
<PackageVersion Include="Uno.WinUI.Markup" Version="5.0.8" />
35+
<PackageVersion Include="Uno.Toolkit.WinUI.Markup" Version="5.0.11" />
36+
<PackageVersion Include="Uno.Extensions.Navigation.WinUI.Markup" Version="3.0.8" />
37+
<PackageVersion Include="Uno.Extensions.Reactive.WinUI.Markup" Version="3.0.8" />
38+
<PackageVersion Include="Uno.Material.WinUI.Markup" Version="4.0.2" />
39+
<PackageVersion Include="Uno.Themes.WinUI.Markup" Version="4.0.2" />
40+
<PackageVersion Include="Uno.WinUI.DevServer" Version="5.0.17" />
41+
<PackageVersion Include="Uno.WinUI.Skia.Gtk" Version="5.0.17" />
42+
<PackageVersion Include="Uno.WinUI.WebAssembly" Version="5.0.17" />
43+
<PackageVersion Include="Xamarin.Google.Android.Material" Version="1.9.0.2" />
44+
</ItemGroup>
45+
</Project>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<local:App x:Class="TubePlayer.AppHead"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="using:TubePlayer">
5+
</local:App>
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
using System;
2+
using Microsoft.Extensions.Logging;
3+
using Microsoft.UI.Xaml;
4+
using Uno.Resizetizer;
5+
6+
namespace TubePlayer;
7+
8+
public sealed partial class AppHead : App
9+
{
10+
static AppHead() =>
11+
InitializeLogging();
12+
13+
/// <summary>
14+
/// Initializes the singleton application object. This is the first line of authored code
15+
/// executed, and as such is the logical equivalent of main() or WinMain().
16+
/// </summary>
17+
public AppHead()
18+
{
19+
this.InitializeComponent();
20+
}
21+
22+
/// <summary>
23+
/// Invoked when the application is launched normally by the end user. Other entry points
24+
/// will be used such as when the application is launched to open a specific file.
25+
/// </summary>
26+
/// <param name="args">Details about the launch request and process.</param>
27+
protected override void OnLaunched(LaunchActivatedEventArgs args)
28+
{
29+
Resources.Build(r => r.Merged(
30+
new AppResources()));
31+
32+
base.OnLaunched(args);
33+
34+
MainWindow.SetWindowIcon();
35+
}
36+
37+
/// <summary>
38+
/// Configures global Uno Platform logging
39+
/// </summary>
40+
private static void InitializeLogging()
41+
{
42+
#if DEBUG
43+
// Logging is disabled by default for release builds, as it incurs a significant
44+
// initialization cost from Microsoft.Extensions.Logging setup. If startup performance
45+
// is a concern for your application, keep this disabled. If you're running on the web or
46+
// desktop targets, you can use URL or command line parameters to enable it.
47+
//
48+
// For more performance documentation: https://platform.uno/docs/articles/Uno-UI-Performance.html
49+
50+
var factory = LoggerFactory.Create(builder =>
51+
{
52+
#if __WASM__
53+
builder.AddProvider(new global::Uno.Extensions.Logging.WebAssembly.WebAssemblyConsoleLoggerProvider());
54+
#elif __IOS__ || __MACCATALYST__
55+
builder.AddProvider(new global::Uno.Extensions.Logging.OSLogLoggerProvider());
56+
#elif NETFX_CORE
57+
builder.AddDebug();
58+
#else
59+
builder.AddConsole();
60+
#endif
61+
62+
// Exclude logs below this level
63+
builder.SetMinimumLevel(LogLevel.Information);
64+
65+
// Default filters for Uno Platform namespaces
66+
builder.AddFilter("Uno", LogLevel.Warning);
67+
builder.AddFilter("Windows", LogLevel.Warning);
68+
builder.AddFilter("Microsoft", LogLevel.Warning);
69+
70+
// Generic Xaml events
71+
// builder.AddFilter("Microsoft.UI.Xaml", LogLevel.Debug );
72+
// builder.AddFilter("Microsoft.UI.Xaml.VisualStateGroup", LogLevel.Debug );
73+
// builder.AddFilter("Microsoft.UI.Xaml.StateTriggerBase", LogLevel.Debug );
74+
// builder.AddFilter("Microsoft.UI.Xaml.UIElement", LogLevel.Debug );
75+
// builder.AddFilter("Microsoft.UI.Xaml.FrameworkElement", LogLevel.Trace );
76+
77+
// Layouter specific messages
78+
// builder.AddFilter("Microsoft.UI.Xaml.Controls", LogLevel.Debug );
79+
// builder.AddFilter("Microsoft.UI.Xaml.Controls.Layouter", LogLevel.Debug );
80+
// builder.AddFilter("Microsoft.UI.Xaml.Controls.Panel", LogLevel.Debug );
81+
82+
// builder.AddFilter("Windows.Storage", LogLevel.Debug );
83+
84+
// Binding related messages
85+
// builder.AddFilter("Microsoft.UI.Xaml.Data", LogLevel.Debug );
86+
// builder.AddFilter("Microsoft.UI.Xaml.Data", LogLevel.Debug );
87+
88+
// Binder memory references tracking
89+
// builder.AddFilter("Uno.UI.DataBinding.BinderReferenceHolder", LogLevel.Debug );
90+
91+
// DevServer and HotReload related
92+
// builder.AddFilter("Uno.UI.RemoteControl", LogLevel.Information);
93+
94+
// Debug JS interop
95+
// builder.AddFilter("Uno.Foundation.WebAssemblyRuntime", LogLevel.Debug );
96+
});
97+
98+
global::Uno.Extensions.LogExtensionPoint.AmbientLoggerFactory = factory;
99+
100+
#if HAS_UNO
101+
global::Uno.UI.Adapter.Microsoft.Extensions.Logging.LoggingAdapter.Initialize();
102+
#endif
103+
#endif
104+
}
105+
}
Lines changed: 42 additions & 0 deletions
Loading
Lines changed: 15 additions & 0 deletions
Loading
Lines changed: 16 additions & 0 deletions
Loading
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project Sdk="Microsoft.Build.NoTargets/3.7.0">
2+
<PropertyGroup>
3+
<!-- NOTE: The TargetFramework is required by MSBuild but not used as this project is not built. -->
4+
<TargetFramework>net7.0</TargetFramework>
5+
<EnableDefaultItems>false</EnableDefaultItems>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<None Include="**\*" Exclude="obj\**;bin\**;*.csproj" />
10+
<None Update="AppHead.xaml.cs" DependentUpon="AppHead.xaml" />
11+
</ItemGroup>
12+
</Project>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<Project>
2+
<ItemGroup>
3+
<PackageReference Include="Uno.Resizetizer" />
4+
</ItemGroup>
5+
6+
<ItemGroup>
7+
<None Include="$(MSBuildThisFileDirectory)AppHead.xaml" />
8+
<ApplicationDefinition Include="$(MSBuildThisFileDirectory)AppHead.xaml"
9+
SubType="Designer"
10+
XamlRuntime="WinUI"
11+
Generator="MSBuild:Compile"
12+
Link="AppHead.xaml" />
13+
<Compile Include="$(MSBuildThisFileDirectory)AppHead.xaml.cs"
14+
XamlRuntime="WinUI"
15+
DependentUpon="AppHead.xaml"
16+
Link="AppHead.xaml.cs" />
17+
<UnoIcon Include="$(MSBuildThisFileDirectory)Icons\icon.svg"
18+
ForegroundFile="$(MSBuildThisFileDirectory)Icons\icon_foreground.svg"
19+
ForegroundScale="0.65"
20+
Color="#00000000" />
21+
<UnoSplashScreen
22+
Include="$(MSBuildThisFileDirectory)Splash\splash_screen.svg"
23+
BaseSize="128,128"
24+
Color="#FFFFFF" />
25+
<!-- NOTE: Files explicitly linked to display in the head projects for clarity. -->
26+
<None Include="$(MSBuildThisFileDirectory)Icons\icon.svg" Link="Icons\icon.svg" />
27+
<None Include="$(MSBuildThisFileDirectory)Icons\icon_foreground.svg" Link="Icons\icon_foreground.svg" />
28+
<None Include="$(MSBuildThisFileDirectory)Splash\splash_screen.svg" Link="Splash\splash_screen.svg" />
29+
</ItemGroup>
30+
</Project>

0 commit comments

Comments
 (0)