diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-09-28 20:45:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-28 20:45:53 +0200 |
commit | 4e19e3603b6e3a0ed08b7d6128fa90a6efe24366 (patch) | |
tree | 94d65af3fcf12b487484ae2ce81c09f21ae78650 /platform/android/java | |
parent | b7066efe9034d1daa9f4038b5600914d440bce62 (diff) | |
parent | 2717891141446df653648d38745ec9de977415f0 (diff) |
Merge pull request #41385 from m4gr3d/fix_splash_loading_master
Fix splash screen loading on Android
Diffstat (limited to 'platform/android/java')
-rw-r--r-- | platform/android/java/app/AndroidManifest.xml | 2 | ||||
-rw-r--r-- | platform/android/java/app/res/drawable/splash.png | bin | 0 -> 14766 bytes | |||
-rw-r--r-- | platform/android/java/app/res/drawable/splash_bg_color.png | bin | 0 -> 1360 bytes | |||
-rw-r--r-- | platform/android/java/app/res/drawable/splash_drawable.xml | 12 | ||||
-rw-r--r-- | platform/android/java/app/res/values/themes.xml | 9 | ||||
-rw-r--r-- | platform/android/java/app/src/com/godot/game/GodotApp.java | 7 |
6 files changed, 29 insertions, 1 deletions
diff --git a/platform/android/java/app/AndroidManifest.xml b/platform/android/java/app/AndroidManifest.xml index 48c09552c1..e94681659c 100644 --- a/platform/android/java/app/AndroidManifest.xml +++ b/platform/android/java/app/AndroidManifest.xml @@ -38,7 +38,7 @@ <activity android:name=".GodotApp" android:label="@string/godot_project_name_string" - android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" + android:theme="@style/GodotAppSplashTheme" android:launchMode="singleTask" android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|density|keyboard|navigation|screenLayout|uiMode" diff --git a/platform/android/java/app/res/drawable/splash.png b/platform/android/java/app/res/drawable/splash.png Binary files differnew file mode 100644 index 0000000000..7bddd4325a --- /dev/null +++ b/platform/android/java/app/res/drawable/splash.png diff --git a/platform/android/java/app/res/drawable/splash_bg_color.png b/platform/android/java/app/res/drawable/splash_bg_color.png Binary files differnew file mode 100644 index 0000000000..004b6fd508 --- /dev/null +++ b/platform/android/java/app/res/drawable/splash_bg_color.png diff --git a/platform/android/java/app/res/drawable/splash_drawable.xml b/platform/android/java/app/res/drawable/splash_drawable.xml new file mode 100644 index 0000000000..2794a40817 --- /dev/null +++ b/platform/android/java/app/res/drawable/splash_drawable.xml @@ -0,0 +1,12 @@ +<?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:src="@drawable/splash" /> + </item> + +</layer-list> diff --git a/platform/android/java/app/res/values/themes.xml b/platform/android/java/app/res/values/themes.xml new file mode 100644 index 0000000000..26912538d3 --- /dev/null +++ b/platform/android/java/app/res/values/themes.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + + <style name="GodotAppMainTheme" parent="@android:style/Theme.Black.NoTitleBar.Fullscreen"/> + + <style name="GodotAppSplashTheme" parent="@style/GodotAppMainTheme"> + <item name="android:windowBackground">@drawable/splash_drawable</item> + </style> +</resources> diff --git a/platform/android/java/app/src/com/godot/game/GodotApp.java b/platform/android/java/app/src/com/godot/game/GodotApp.java index 1af5950cbe..51df70969e 100644 --- a/platform/android/java/app/src/com/godot/game/GodotApp.java +++ b/platform/android/java/app/src/com/godot/game/GodotApp.java @@ -32,9 +32,16 @@ package com.godot.game; import org.godotengine.godot.FullScreenGodotApp; +import android.os.Bundle; + /** * Template activity for Godot Android custom builds. * Feel free to extend and modify this class for your custom logic. */ public class GodotApp extends FullScreenGodotApp { + @Override + public void onCreate(Bundle savedInstanceState) { + setTheme(R.style.GodotAppMainTheme); + super.onCreate(savedInstanceState); + } } |