question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Splash screen jump

See original GitHub issue

The splash screens are misaligned and cause jump similar to the react-native-splash-screen.

Tested on Pixel 3 XL emulator and real device 19:8 aspect ratio.

Installed the latest version and followed the instructions on https://www.npmjs.com/package/react-native-bootsplash almost the same

The differences are Styles.xml

<resources>
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:textColor">#000000</item>
        <item name="android:statusBarColor">@color/statusbar</item>
        <item name="android:windowLightStatusBar">true</item>

        <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
    </style>

    <style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:background">@drawable/background_splash</item>
        <item name="android:statusBarColor">@color/splash</item>
        <item name="android:windowLightStatusBar">true</item>
        <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
    </style>
</resources>

background_splash

<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque">
  <item android:drawable="@color/splash" />

  <item
        android:width="222dp"
        android:height="222dp"
        android:drawable="@mipmap/icon"
        android:gravity="center" />
</layer-list>

Why is this happening?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:47 (17 by maintainers)

github_iconTop GitHub Comments

7reactions
Yashpk789987commented, Dec 12, 2020

After using <item name="android:windowTranslucentStatus">true</item> status bar was hidden but the problem is react-native-keyboard-aware-scroll-view stopped working on android

i found the problem was using <item name="android:windowTranslucentStatus">true</item> causes this issue so for anyone’s need

i created native module so that after hiding the splash we can set android:windowTranslucentStatus = false

Screenshot 2020-12-13 at 5 24 02 AM

And then after hiding splash

await RNBootSplash.hide({fade: true}); if (Platform.OS === 'android') { NativeModules.StatusBarModule.toggle(false); }

7reactions
zoontekcommented, Jan 30, 2020

@whimsicaldreamer The issue here is that you set your status bar style directly in code (in your MainActivity) but your app does not start with it (it uses RNBootSplashActivity).

So instead of Java code, try to set your styles with a dedicated file (styles-v28.xml for Android Pie):

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="android:textColor">#000000</item>
    <item name="android:windowDrawsSystemBarBackgrounds">true</item>
    <item name="android:windowTranslucentStatus">true</item>
    <item name="android:windowTranslucentNavigation">true</item>
    <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>

<style name="BootTheme" parent="AppTheme">
    <item name="android:background">@drawable/bootsplash</item>
</style>

Not sure about the android config keys, but you get the idea 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android splash screen jump java - Stack Overflow
I wanted to implement a splash screen but in a correct way - no superficial delay, only showing it while the app is...
Read more >
Splash screen jumping up on android #385 - GitHub
On android, there is a small jump up (approx. the height of the status bar, so I suspect it has to do with...
Read more >
Implementing the Perfect Splash Screen in Android - Medium
A Splash Screen referred to as a launch screen or startup screen and shows up when your app is loading, and its perfect...
Read more >
What is causing unexpected motion of a logo on splash screen?
I noticed that the logo will 'jump' once on the screen. In order to avoid this unexpected 'jump' I changed to this method:...
Read more >
Splash Screen shifts up then down on cold start : r/androiddev
So I created a splash screen for my app (according to this link ). Everything works fine until the app cold starts or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found