Android Splash Screen position issue, fullscreen?

Hi,

I’ve got an issue with my splash screen, for better understanding I did a video of what’s going on splashscreen

As you can see, when the SplashScreen plugin displays its splash screen, the image has not the same position as the previous one.

I’m on Capacitor 3

I’ve created 9 patch splash files by following this tutorial to avoid the image to be stretched. Maybe that’s the issue.

Here is my splash screen configuration from capacitor.config.ts:

    SplashScreen: {
      androidSplashResourceName: 'splash',
      launchShowDuration: 10000,
      showSpinner: false,
      backgroundColor: '#000000',
      androidScaleType: 'FIT_XY',
      splashFullScreen: false,
      splashImmersive: false,
      launchAutoHide: false,
    }

In AndroidManifest.xml I have:

    <activity
      android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
      android:name="app.wako.MainActivity"
      android:label="@string/title_activity_main"
      android:theme="@style/AppTheme.NoActionBarLaunch"
      android:launchMode="singleTask">

And in my styles.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>

  <!-- Base application theme. -->
  <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
  </style>

  <style name="AppTheme.NoActionBar" parent="Theme.AppCompat.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
    <item name="android:background">@null</item>
  </style>


  <style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">
    <item name="android:background">@drawable/splash</item>
  </style>
</resources>

Thanks

Did you find this github issue?

It`s a tricky topic. But I found a solution in the github issue.

Hi,

Thanks for you reply.

Yes I did follow some workarounds, but I didn’t find one that works. The only solution that seemed to work (based on his video) is Splash Screen scaling displays twice · Issue #1627 · ionic-team/capacitor · GitHub but the java code has changed since capacitor 3.

Did you find a good solution?

I decided to just show a background color in the first step, and than the image in second step. Its just a workaround, too...for me its fine. You can see the result in my app