react-native-bootsplash 4.2.1 → 4.2.2
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
|
|
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
|
[](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
|
-
##
|
|
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;
|
|
@@ -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
|
-
|
|
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