![]() |
VOOZH | about |
dotnet add package Nventive.ExtendedSplashScreen.Uno --version 1.0.2
NuGet\Install-Package Nventive.ExtendedSplashScreen.Uno -Version 1.0.2
<PackageReference Include="Nventive.ExtendedSplashScreen.Uno" Version="1.0.2" />
<PackageVersion Include="Nventive.ExtendedSplashScreen.Uno" Version="1.0.2" />Directory.Packages.props
<PackageReference Include="Nventive.ExtendedSplashScreen.Uno" />Project file
paket add Nventive.ExtendedSplashScreen.Uno --version 1.0.2
#r "nuget: Nventive.ExtendedSplashScreen.Uno, 1.0.2"
#:package Nventive.ExtendedSplashScreen.Uno@1.0.2
#addin nuget:?package=Nventive.ExtendedSplashScreen.Uno&version=1.0.2Install as a Cake Addin
#tool nuget:?package=Nventive.ExtendedSplashScreen.Uno&version=1.0.2Install as a Cake Tool
Extended splashscreen allows to control when to dismiss the splashscreen. It also gives the developer the ability to add additional xaml content to display while the application is being loaded.
Install the latest version of Nventive.ExtendedSplashScreen.Uno or Nventive.ExtendedSplashScreen.Uno.WinUI.
Setup the root content of the window to be a custom UserControl instead of a Frame.
(We called this UserControl "Shell" in the following steps.)
Shell shell = window.Content as Shell;
if (shell == null)
{
shell = new Shell(e);
window.Content = rootFrame;
}
In the UserControl, put the following:
Frame (or anything else that you need) to display the app content.ExtendedSplashScreen control.It is important to put the ExtendedSplashScreen control below than the Frame so that the splash screen hides the app content.
<UserControl x:Class="ExtendedSlashScreen.Uno.Samples.Shell"
...
xmlns:splash="using:Nventive.ExtendedSplashScreen">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Frame x:Name="RootNavigationFrame" />
<splash:ExtendedSplashScreen x:Name="AppExtendedSplashScreen" />
</Grid>
</UserControl>
Expose the IExtendedSplashScreen publicly from the code behind of you UserControl.
In this sample we do it by exposing a ExtendedSplashScreen property and containing the IExtendedSplashScreen and a static Instance property containing the latest instance of the Shell.
public sealed partial class Shell : UserControl
{
public static Shell Instance { get; private set; }
public Shell(LaunchActivatedEventArgs e)
{
this.InitializeComponent();
Instance = this;
#if WINDOWS_UWP // Do this only if you target UWP.
AppExtendedSplashScreen.SplashScreen = e?.SplashScreen;
#endif
NavigationFrame.Navigate(typeof(MainPage), e.Arguments);
}
public IExtendedSplashScreen ExtendedSplashScreen => this.AppExtendedSplashScreen;
public Frame NavigationFrame => this.RootNavigationFrame;
}
Add code to dismiss the ExtendedSplashScreen for when your app is ready to be displayed.
Shell.Instance.ExtendedSplashScreen.Dismiss();
Create a style for the ExtendedSplashScreen control.
<Style x:Key="DefaultExtendedSplashScreenStyle"
TargetType="splash:ExtendedSplashScreen">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="splash:ExtendedSplashScreen">
<Grid x:Name="RootGrid">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="SplashScreenStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Dismissed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid"
Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0:0:0.150"
Value="Collapsed" />
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation Storyboard.TargetName="RootGrid"
Storyboard.TargetProperty="Opacity"
To="0"
Duration="0:0:0.150" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentPresenter x:Name="SplashScreenPresenter" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Apply the style to the ExtendedSplashScreen control in your UserControl.
<splash:ExtendedSplashScreen x:Name="AppExtendedSplashScreen"
Style="{StaticResource DefaultExtendedSplashScreenStyle}" />
💡 You can skip this part if you setup an implicit style.
The native splash screen behavior changes starting at Android 12. See reference.
ExtendedSplashScreen supports the Android 12+ behavior.
You need to add the following code in your MainActivity.cs to override the default behavior.
public sealed class MainActivity : Microsoft.UI.Xaml.ApplicationActivity
{
protected override void OnCreate(Bundle bundle)
{
// Handle the splash screen transition.
Nventive.ExtendedSplashScreen.ExtendedSplashScreen.AndroidSplashScreen = AndroidX.Core.SplashScreen.SplashScreen.InstallSplashScreen(this);
// It's important to call base.OnCreate AFTER setting ExtendedSplashScreen.AndroidSplashScreen.
base.OnCreate(bundle);
}
}
Note that when you run your app in debug from Visual Studio (or other IDEs), the new SplashScreen icon doesn't show. It shows when you run the app from the launcher (even debug builds).
You can enable trace logs on the Nventive.ExtendedSplashScreen namespace to get more information about the runtime behavior.
You can override the logger via ExtendedSplashScreen.Logger.
By default, one is created using the AmbientLoggerFactory from the Uno.Core.Extensions.Logging.Singleton package.
Please consult the for more information about version history.
This project is licensed under the Apache 2.0 license - see the file for details.
Please read for details on the process for contributing to this project.
Be mindful of our .
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 is compatible. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. monoandroid12.0 monoandroid12.0 is compatible. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Universal Windows Platform | uap10.0.19041 uap10.0.19041 is compatible. |
| Xamarin.iOS | xamarinios xamarinios was computed. xamarinios10 xamarinios10 is compatible. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.2 | 7,168 | 12/13/2023 |
| 1.0.2-feature.Uno5Update.2 | 175 | 11/3/2023 |
| 1.0.1 | 4,362 | 9/25/2023 |
| 1.0.0 | 277 | 9/14/2023 |
| 1.0.0-dev.64 | 160 | 9/14/2023 |
| 0.7.2-dev.62 | 175 | 9/13/2023 |
| 0.5.0-dev.60 | 7,274 | 3/1/2023 |
| 0.4.0-dev.57 | 229 | 2/28/2023 |
| 0.4.0-dev.55 | 243 | 2/27/2023 |
| 0.3.0-dev.51 | 816 | 12/24/2022 |
| 0.3.0-dev.40 | 2,794 | 10/13/2022 |
| 0.3.0-dev.38 | 1,992 | 9/28/2022 |
| 0.3.0-dev.33 | 53,997 | 4/6/2022 |
| 0.2.0-dev.24 | 77,085 | 3/18/2021 |
| 0.1.0-dev.22 | 25,123 | 12/24/2020 |
| 0.1.0-dev.20 | 1,657 | 11/2/2020 |
| 0.1.0-dev.18 | 20,193 | 8/24/2020 |
| 0.1.0-dev.16 | 5,604 | 8/14/2020 |
| 0.1.0-dev.14 | 463 | 6/26/2020 |