LaunchImage detached Expo app

Hi,

I have a detached expo app and I want to setup my Launch Image. I’m not sure if I am doing this correctly:

I removed this in ExShell.plst:

	<key>isSplashScreenDisabled</key>
	<true/>

I noticed there is a Supporting/launch_background_image.png and a Supporting/launch_icon.png - is launch_icon.png where my loading spinner goes and launch_background_image.png my where my background goes?

And I also have a LaunchImage source with all dimensions - can I use that instead of launch_background_image.png?

See image below of what my Launch Screen build settings are (wondering if they are correct):
09%20AM

All of this works but my LaunchImages with all dimensions get replaced with launch_background_image.png and launch_background_image.png only comes in 1 dimensions so the screen looks different because the image is the correct dimension once my LaunchImage loads.

42%20AM

please see https://docs.expo.io/versions/v27.0.0/guides/splash-screens#detached-expokit-apps

1 Like

@notbrett Those instructions don’t say anything about what to do for Android. Do we continue to use the “splash” key in the app.json file for Android as a detached ExpoKit project?

I’ve also been looking for how to change the splash for Android on a detached app. Those instructions are clear enough for iOS, but no mention of Android. I’ve been digging through the Android project without much luck.

If you are still trying to fix this, I did track down the splash in the android project. I swapped out this image with my new splash to make it work: android/app/src/main/res/drawable-xxxhdpi/shell_launch_background_image.png

Oh yeah, looks like docs need some update. Quick guide before we publish it:
Android’s splash is based on a Theme that is called Theme.Exponent.Splash and is probably not editable, it uses a drawable that you can find in res/drawable/splash_background.xml and modify in whatever way you want to. The basic version just defines background color and specifies the image to use, as @maxmike83 mentioned: shell_launch_background_image .
However, this possibly won’t work if you use resizeMode: cover in splash configuration. A native view is then added. So you might change the resizeMode back to containt and modify the xml as you want

Unfortunately, it looks like resizeMode contain doesn’t work properly either – if the image is too low-resolution given the device DPI setting it won’t be stretched to fit the screen (and if it’s too large it’ll run off the edges). In other words, there’s no actual “contain”-ing going on.

This is our splash_background.xml, as generated by the Android detach code:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:drawable="@color/splashBackground"/>

    <item><bitmap android:gravity="center" android:src="@drawable/shell_launch_background_image" /></item>

</layer-list>

Based on my understanding, the android:gravity="center" parameter only centers the image on the screen, but doesn’t affect the size or scaling.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.