Skip to content

Commit

Permalink
fix: wasm splashscreen support (#1071)
Browse files Browse the repository at this point in the history
* fix: wasm splashscreen support

chore: pr comments

* chore: fix merge

* chore: pr comments

* chore: fix macos partial

* chore: ExtendedSplashScreen.macOS.cs

* chore: ExtendedSplashScreen.macOS.cs
  • Loading branch information
kazo0 committed Mar 20, 2024
1 parent 3608c1d commit 7f3037b
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if WINDOWS || WINDOWS_UWP || NET472_OR_GREATER || NETSTANDARD2_0
#if WINDOWS || WINDOWS_UWP || __SKIA_OR_WASM__
using System;
using System.Linq;
using System.Threading;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,4 @@ private async Task LoadNativeSplashScreen()
SplashScreenContent = splashScreenContent;
}
}


#if !__ANDROID__ && !__IOS__ && !(WINDOWS || WINDOWS_UWP) && !NETSTANDARD2_0
private static Task<FrameworkElement?> GetNativeSplashScreen()
{
return Task.FromResult<FrameworkElement?>(null);
}

public bool SplashIsEnabled => (Platforms & SplashScreenPlatform.All) != 0;
#endif

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#if !__ANDROID__ && !__IOS__ && !(WINDOWS || WINDOWS_UWP) && !__SKIA_OR_WASM__

#if IS_WINUI
using Microsoft.UI.Xaml;
#else
using Windows.UI.Xaml;
#endif
using System.Threading.Tasks;

namespace Uno.Toolkit.UI;

public partial class ExtendedSplashScreen
{
private static Task<FrameworkElement?> GetNativeSplashScreen()
{
return Task.FromResult<FrameworkElement?>(null);
}

public bool SplashIsEnabled => (Platforms & SplashScreenPlatform.All) != 0;
}
#endif
5 changes: 5 additions & 0 deletions src/Uno.Toolkit.UI/Uno.Toolkit.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
<UnoXamlResourcesTrimming Condition="'$(OS)'=='Windows_NT' or '$(MSBuildRuntimeType)'=='Core'">true</UnoXamlResourcesTrimming>
</PropertyGroup>

<!-- Undo this as part of https://github.com/unoplatform/uno.toolkit.ui/issues/1078 once we update to Uno 5.1+ -->
<PropertyGroup>
<DefineConstants Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == ''">$(DefineConstants);__SKIA_OR_WASM__</DefineConstants>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Uno.Toolkit\Uno.Toolkit.csproj" />
</ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions src/Uno.Toolkit.UI/Uno.Toolkit.WinUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
<UnoXamlResourcesTrimming Condition="'$(OS)'=='Windows_NT' or '$(MSBuildRuntimeType)'=='Core'">true</UnoXamlResourcesTrimming>
</PropertyGroup>

<!-- Undo this as part of https://github.com/unoplatform/uno.toolkit.ui/issues/1078 once we update to Uno 5.1+ -->
<PropertyGroup>
<DefineConstants Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == ''">$(DefineConstants);__SKIA_OR_WASM__</DefineConstants>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Uno.Toolkit\Uno.Toolkit.csproj" />
</ItemGroup>
Expand Down

0 comments on commit 7f3037b

Please sign in to comment.