Skip to content

Commit ee3db46

Browse files
committed
fix!: extended-splashscreen not working on skia-mobile
1 parent 3a3a029 commit ee3db46

File tree

7 files changed

+125
-801
lines changed

7 files changed

+125
-801
lines changed

doc/controls/ExtendedSplashScreen.md

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ uid: Toolkit.Controls.ExtendedSplashScreen
33
---
44
# ExtendedSplashScreen
55

6-
Represents a control, derived from [`LoadingView`](xref:Toolkit.Controls.LoadingView) that displays a view that replicates the appearance and behavior of the target platform's native application loading screen.
6+
Represents a control, derived from [`LoadingView`](xref:Toolkit.Controls.LoadingView) that displays a view that simulates the appearance and behavior of the target platform's native application loading screen.
77

88
Refer to [`LoadingView`](xref:Toolkit.Controls.LoadingView) for a list of inherited members.
99

@@ -20,30 +20,8 @@ A common use case for this control is to display an application loading element
2020
>
2121
> [!Video https://www.youtube-nocookie.com/embed/jMI4E2e9gYE]
2222
23-
## Properties
24-
25-
| Property | Type | Description | Value |
26-
|----------|------|-------------|---------------|
27-
| **Platforms** | `SplashScreenPlatform` | Gets or sets the platform(s) where extended splash screen should be used. This is a flag enumeration, which allows for combining multiple values eg: `"Android,iOS"` | Default value is **All**. Other possible values include **Android**, **iOS**, **Windows**, **WebAssembly**, **Skia**, and **None**. |
28-
| **SplashIsEnabled** | `bool` | Gets a value representing whether the current environment is to display this splash screen. | **True** if the current platform is included in the **Platforms** property, otherwise **false**. |
29-
30-
## Methods
31-
32-
| Method | Return Type | Description |
33-
|--------|-------------|-------------|
34-
| **Init** | `void` | Initializes the splash screen for the provided `Activity` instance. This static method should be invoked from the **OnCreate** override in `MainActivity`.<br/>**Note: This method only needs to be called on Android** |
35-
3623
## Usage
3724

38-
### Specify platforms to display splash screen
39-
40-
The following code snippet will only display the splash screen on Android and iOS by specifying a `SplashScreenPlatform` value for the `Platforms` property.
41-
42-
```xml
43-
<utu:ExtendedSplashScreen x:Name="Splash"
44-
Platforms="Android,iOS" />
45-
```
46-
4725
### Setup the splash screen
4826

4927
The following code snippet demonstrates a suggested pattern for using the `ExtendedSplashScreen`. The first step is to define a custom `UserControl` that will be used as the main shell for the application content. This control will be used to host the `ExtendedSplashScreen` and the main application content.
@@ -96,7 +74,7 @@ Next, the `Shell` control should be used as the root visual for the `Window` in
9674
```csharp
9775
protected override async void OnLaunched(LaunchActivatedEventArgs args)
9876
{
99-
// Code ommited for brevity
77+
// Boilerplate code omitted for brevity
10078
10179
if (MainWindow.Content is not Shell shell)
10280
{
@@ -119,17 +97,3 @@ protected override async void OnLaunched(LaunchActivatedEventArgs args)
11997
With these changes, the splash screen will be displayed when the application first launches and the main application content will be displayed once the loading state is complete.
12098

12199
In order to prolong the splash screen display, you can set the `Source` property of the `ExtendedSplashScreen` control to any custom implementation of the `ILoadable` interface. More information on how to use the `ILoadable` interface can be found in the [`LoadingView`](xref:Toolkit.Controls.LoadingView#iloadable) documentation.
122-
123-
## Setup on Android
124-
125-
To use the `ExtendedSplashScreen` on Android, you need to add the following to your `MainActivity`:
126-
127-
```csharp
128-
protected override void OnCreate(Bundle bundle)
129-
{
130-
// Handle the splash screen transition.
131-
Uno.Toolkit.UI.ExtendedSplashScreen.Init(this);
132-
133-
base.OnCreate(bundle);
134-
}
135-
```

src/Uno.Toolkit.UI/Controls/ExtendedSplashScreen/ExtendedSplashScreen.Android.cs

Lines changed: 0 additions & 327 deletions
This file was deleted.

0 commit comments

Comments
 (0)