react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

How to disable addDefaultSplashLayout in NavigationActivity on android ?

Open roidayan1 opened this issue 7 years ago • 4 comments

When app starts its shows white screen between splash screen and first navigation route.

I've been researched it and came to it that this is because of addDefaultSplashLayout in the NavigationActivity fired from onCreate. when i delete this call, the native splash is hanging and the first navigation route never appears.

i want to show the first navigation route immediately when app starts or immediately after native splash screen.


Environment

  • React Native Navigation version: 2.13.1
  • React Native version: 0.58.6
  • Platform(s) (iOS, Android, or both?): Android

roidayan1 avatar Mar 09 '19 10:03 roidayan1

Hi @RoiDayan1 ,

I had the same issue and I think I solved it by adding this in my MainActivity.java:

@Override
    protected void addDefaultSplashLayout() {
        View view = new View(this);
        view.setBackgroundColor(Color.parseColor("#1C299F"));
        setContentView(view);
    }

Where #1C299F is the background color you would the to use instead of white.

Hope it helps!

EDIT: Sorry, not really the ideal solution, since you (and I) would like to remove it completely. Maybe my solution could be better than nothing though?

billyohgren avatar Mar 15 '19 09:03 billyohgren

this exactly what I did.. thank you.

roidayan1 avatar Mar 17 '19 03:03 roidayan1

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

stale[bot] avatar Apr 16 '19 04:04 stale[bot]

The issue has been closed for inactivity.

stale[bot] avatar Apr 23 '19 04:04 stale[bot]