Update the splash screen logic for the Godot app template
Due to limitations to the splash screen introduced in Android 12, the splash screen logic is updated to the same logic as used on other platforms, i.e: the splash screen is rendered by the Godot engine instead of the Android runtime.
This commit is contained in:
parent
dd966f5680
commit
f20e21a6d6
9 changed files with 32 additions and 156 deletions
|
|
@ -32,6 +32,7 @@ configurations {
|
|||
|
||||
dependencies {
|
||||
implementation "androidx.fragment:fragment:$versions.fragmentVersion"
|
||||
implementation "androidx.core:core-splashscreen:$versions.splashscreenVersion"
|
||||
|
||||
if (rootProject.findProject(":lib")) {
|
||||
implementation project(":lib")
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 KiB |
|
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@drawable/splash_bg_color" />
|
||||
|
||||
<item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:filter="false"
|
||||
android:src="@drawable/splash" />
|
||||
</item>
|
||||
</layer-list>
|
||||
|
|
@ -3,8 +3,17 @@
|
|||
|
||||
<style name="GodotAppMainTheme" parent="@android:style/Theme.Black.NoTitleBar"/>
|
||||
|
||||
<style name="GodotAppSplashTheme" parent="@android:style/Theme.Black.NoTitleBar.Fullscreen">
|
||||
<item name="android:windowBackground">@drawable/splash_drawable</item>
|
||||
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
|
||||
<style name="GodotAppSplashTheme" parent="Theme.SplashScreen">
|
||||
<!-- Set the splash screen background, animated icon, and animation
|
||||
duration. -->
|
||||
<item name="android:windowSplashScreenBackground">@mipmap/icon_background</item>
|
||||
|
||||
<!-- Use windowSplashScreenAnimatedIcon to add a drawable or an animated
|
||||
drawable. One of these is required. -->
|
||||
<item name="windowSplashScreenAnimatedIcon">@mipmap/icon_foreground</item>
|
||||
|
||||
<!-- Set the theme of the Activity that directly follows your splash
|
||||
screen. This is required. -->
|
||||
<item name="postSplashScreenTheme">@style/GodotAppMainTheme</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ import org.godotengine.godot.GodotActivity;
|
|||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.core.splashscreen.SplashScreen;
|
||||
|
||||
/**
|
||||
* Template activity for Godot Android builds.
|
||||
* Feel free to extend and modify this class for your custom logic.
|
||||
|
|
@ -41,7 +43,7 @@ import android.os.Bundle;
|
|||
public class GodotApp extends GodotActivity {
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
setTheme(R.style.GodotAppMainTheme);
|
||||
SplashScreen.installSplashScreen(this);
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue