react-native-bootsplash 4.2.0 → 4.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # 🚀 react-native-bootsplash
2
2
 
3
- Show a bootsplash during app startup. Hide it when you are ready.<br>
3
+ Show a splash screen during app startup. Hide it when you are ready.<br>
4
4
  **For migration from the v3, check the [`MIGRATION.md` guide](https://github.com/zoontek/react-native-bootsplash/blob/master/MIGRATION.md).**
5
5
 
6
6
  [![npm version](https://badge.fury.io/js/react-native-bootsplash.svg)](https://www.npmjs.org/package/react-native-bootsplash)
@@ -369,7 +369,7 @@ function App() {
369
369
 
370
370
  **🤙 A more complex example is available in the [`/example` folder](example).**
371
371
 
372
- ## Using React Navigation
372
+ ## With React Navigation
373
373
 
374
374
  If you are using React Navigation, you can hide the splash screen once the navigation container and all children have finished mounting by using the `onReady` function.
375
375
 
@@ -387,6 +387,11 @@ function App() {
387
387
  }
388
388
  ```
389
389
 
390
+
391
+ ## With react-native-bars
392
+
393
+ In order to keep fully transparent status and navigation bars on Android once the splash screen is hidden (and control them), this library play nicely with [react-native-bars](https://github.com/zoontek/react-native-bars). Check the [README](https://github.com/zoontek/react-native-bars/blob/main/README.md#with-react-native-bootsplash) for more informations.
394
+
390
395
  ## Testing with Jest
391
396
 
392
397
  Testing code which uses this library requires some setup since we need to mock the native methods.
@@ -3,8 +3,10 @@ package com.zoontek.rnbootsplash;
3
3
  import android.animation.Animator;
4
4
  import android.animation.AnimatorListenerAdapter;
5
5
  import android.app.Activity;
6
+ import android.os.Build;
6
7
  import android.view.View;
7
8
  import android.view.animation.AccelerateInterpolator;
9
+ import android.window.SplashScreenView;
8
10
 
9
11
  import androidx.annotation.NonNull;
10
12
  import androidx.annotation.Nullable;
@@ -73,7 +75,7 @@ public class RNBootSplashModule extends ReactContextBaseJavaModule {
73
75
  mSplashScreen.setOnExitAnimationListener(new SplashScreen.OnExitAnimationListener() {
74
76
  @Override
75
77
  public void onSplashScreenExit(@NonNull final SplashScreenViewProvider splashScreenViewProvider) {
76
- View splashScreenView = splashScreenViewProvider.getView();
78
+ final View splashScreenView = splashScreenViewProvider.getView();
77
79
 
78
80
  splashScreenView
79
81
  .animate()
@@ -86,7 +88,13 @@ public class RNBootSplashModule extends ReactContextBaseJavaModule {
86
88
  @Override
87
89
  public void onAnimationEnd(Animator animation) {
88
90
  super.onAnimationEnd(animation);
89
- splashScreenViewProvider.remove();
91
+
92
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
93
+ splashScreenViewProvider.remove();
94
+ } else {
95
+ // Avoid calling applyThemesSystemBarAppearance
96
+ ((SplashScreenView) splashScreenView).remove();
97
+ }
90
98
  }
91
99
  }).start();
92
100
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-bootsplash",
3
- "version": "4.2.0",
3
+ "version": "4.2.3",
4
4
  "license": "MIT",
5
5
  "description": "Display a bootsplash on your app starts. Hide it when you want.",
6
6
  "author": "Mathieu Acthernoene <zoontek@gmail.com>",
@@ -60,7 +60,7 @@ module.exports = {
60
60
  projectPath: (ios.xcodeProject
61
61
  ? path.resolve(ios.sourceDir, ios.xcodeProject.name)
62
62
  : ios.projectPath
63
- ).replace(/\.xc(xcodeproj|workspace)$/, ""),
63
+ ).replace(/\.(xcodeproj|xcworkspace)$/, ""),
64
64
  },
65
65
 
66
66
  workingPath,