react-native-bootsplash 4.2.1 â 4.2.4
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,13 +1,14 @@
|
|
|
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
|
-
[](https://github.com/zoontek/react-native-bootsplash/blob/main/LICENSE)
|
|
7
|
+
[](https://www.npmjs.org/package/react-native-bootsplash)
|
|
8
|
+
[](https://www.npmjs.org/package/react-native-bootsplash)
|
|
9
|
+
<br />
|
|
10
|
+
[](https://www.android.com)
|
|
11
|
+
[](https://developer.apple.com/ios)
|
|
11
12
|
|
|
12
13
|
<p>
|
|
13
14
|
<img height="520" src="https://raw.githubusercontent.com/zoontek/react-native-bootsplash/HEAD/docs/ios_demo.gif?raw=true" alt="iOS demo"></img>
|
|
@@ -31,7 +32,7 @@ If your company uses it in a production app, consider sponsoring this project
|
|
|
31
32
|
| 4.0.0+ | 0.65.0+ |
|
|
32
33
|
| 3.0.0+ | 0.63.0+ |
|
|
33
34
|
|
|
34
|
-
##
|
|
35
|
+
## Installation
|
|
35
36
|
|
|
36
37
|
```bash
|
|
37
38
|
$ npm install --save react-native-bootsplash
|
|
@@ -103,7 +104,7 @@ public class MainApplication extends Application implements ReactApplication {
|
|
|
103
104
|
|
|
104
105
|
## Setup
|
|
105
106
|
|
|
106
|
-
âšī¸ For `react-native` < `0.68`
|
|
107
|
+
âšī¸ For `react-native` < `0.68` setup, follow the [`v4.1.3 README.md`](https://github.com/zoontek/react-native-bootsplash/blob/4.1.3/README.md) (it will works with the latest `react-native-bootsplash` version too).
|
|
107
108
|
|
|
108
109
|
### Assets generation
|
|
109
110
|
|
|
@@ -369,7 +370,7 @@ function App() {
|
|
|
369
370
|
|
|
370
371
|
**đ¤ A more complex example is available in the [`/example` folder](example).**
|
|
371
372
|
|
|
372
|
-
##
|
|
373
|
+
## With React Navigation
|
|
373
374
|
|
|
374
375
|
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
376
|
|
|
@@ -387,6 +388,11 @@ function App() {
|
|
|
387
388
|
}
|
|
388
389
|
```
|
|
389
390
|
|
|
391
|
+
|
|
392
|
+
## With react-native-bars
|
|
393
|
+
|
|
394
|
+
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.
|
|
395
|
+
|
|
390
396
|
## Testing with Jest
|
|
391
397
|
|
|
392
398
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "4.2.4",
|
|
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>",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
],
|
|
38
38
|
"scripts": {
|
|
39
39
|
"format": "prettier '**/*' -u -w",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
40
|
+
"postinstall": "git config --local core.hooksPath .hooks",
|
|
41
|
+
"prepack": "bob build"
|
|
42
42
|
},
|
|
43
43
|
"react-native-builder-bob": {
|
|
44
44
|
"source": "src",
|
|
@@ -71,12 +71,12 @@
|
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@types/fs-extra": "^9.0.13",
|
|
74
|
-
"@types/react-native": "^0.
|
|
75
|
-
"lint-staged": "^13.0.
|
|
74
|
+
"@types/react-native": "^0.69.3",
|
|
75
|
+
"lint-staged": "^13.0.3",
|
|
76
76
|
"prettier": "^2.7.1",
|
|
77
77
|
"prettier-plugin-organize-imports": "^3.0.0",
|
|
78
78
|
"react": "^18.0.0",
|
|
79
|
-
"react-native": "^0.69.
|
|
79
|
+
"react-native": "^0.69.2",
|
|
80
80
|
"react-native-builder-bob": "^0.18.3",
|
|
81
81
|
"rescript": "^9.1.4",
|
|
82
82
|
"typescript": "^4.7.4"
|
package/react-native.config.js
CHANGED
|
@@ -54,14 +54,17 @@ module.exports = {
|
|
|
54
54
|
|
|
55
55
|
return generate({
|
|
56
56
|
android,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
|
|
58
|
+
ios: ios
|
|
59
|
+
? {
|
|
60
|
+
...ios,
|
|
61
|
+
// Fix to support previous CLI versions
|
|
62
|
+
projectPath: (ios.xcodeProject
|
|
63
|
+
? path.resolve(ios.sourceDir, ios.xcodeProject.name)
|
|
64
|
+
: ios.projectPath
|
|
65
|
+
).replace(/\.(xcodeproj|xcworkspace)$/, ""),
|
|
66
|
+
}
|
|
67
|
+
: null,
|
|
65
68
|
|
|
66
69
|
workingPath,
|
|
67
70
|
logoPath: path.resolve(workingPath, logoPath),
|