Android: Add export options to customize splash screen
This commit is contained in:
@@ -11,7 +11,8 @@
|
||||
To add custom attributes, use the "gradle_build/custom_theme_attributes" Android export option. -->
|
||||
<style name="GodotAppSplashTheme" parent="Theme.SplashScreen">
|
||||
<item name="android:windowSplashScreenBackground">@mipmap/icon_background</item>
|
||||
<item name="windowSplashScreenAnimatedIcon">@mipmap/icon_foreground</item>
|
||||
<item name="android:windowSplashScreenBrandingImage">@drawable/splash_branding_image</item>
|
||||
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_icon</item>
|
||||
<item name="postSplashScreenTheme">@style/GodotAppMainTheme</item>
|
||||
<item name="android:windowIsTranslucent">false</item>
|
||||
</style>
|
||||
|
||||
@@ -67,9 +67,14 @@ public class GodotApp extends GodotActivity {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
SplashScreen.installSplashScreen(this);
|
||||
SplashScreen splashScreen = SplashScreen.installSplashScreen(this);
|
||||
EdgeToEdge.enable(this);
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
Godot godot = getGodot();
|
||||
if (godot != null && godot.getDisableGodotSplash()) {
|
||||
splashScreen.setKeepOnScreenCondition(() -> godot.getRunStatus() != Godot.RunStatus.STARTED);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -204,6 +204,8 @@ class Godot private constructor(val context: Context) {
|
||||
internal var darkMode = false
|
||||
private var backgroundColor: Int = Color.BLACK
|
||||
private var orientation = Configuration.ORIENTATION_UNDEFINED
|
||||
var disableGodotSplash = false
|
||||
private set
|
||||
|
||||
internal var containerLayout: FrameLayout? = null
|
||||
var renderView: GodotRenderView? = null
|
||||
@@ -276,6 +278,8 @@ class Godot private constructor(val context: Context) {
|
||||
newArgs.add(commandLine[i])
|
||||
} else if (commandLine[i] == "--background_color") {
|
||||
setWindowColor(commandLine[i + 1])
|
||||
} else if (commandLine[i] == "--disable_godot_splash") {
|
||||
disableGodotSplash = true
|
||||
} else if (commandLine[i] == "--use_apk_expansion") {
|
||||
useApkExpansion = true
|
||||
} else if (hasExtra && commandLine[i] == "--apk_expansion_md5") {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 102 B |
Binary file not shown.
|
After Width: | Height: | Size: 6.5 KiB |
Reference in New Issue
Block a user