react-native-bootsplash 4.2.3 → 4.3.1
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 +18 -24
- package/android/build.gradle +1 -1
- package/package.json +7 -7
- package/react-native.config.js +11 -8
package/README.md
CHANGED
|
@@ -3,11 +3,12 @@
|
|
|
3
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,8 +104,6 @@ public class MainApplication extends Application implements ReactApplication {
|
|
|
103
104
|
|
|
104
105
|
## Setup
|
|
105
106
|
|
|
106
|
-
ℹ️ For `react-native` < `0.68` documentation, check the [`v4.1.3 README.md`](https://github.com/zoontek/react-native-bootsplash/blob/4.1.3/README.md)
|
|
107
|
-
|
|
108
107
|
### Assets generation
|
|
109
108
|
|
|
110
109
|
In order to speed up the setup, we provide a **CLI** to generate assets, create the Android Drawable XML file and the iOS Storyboard file automatically ✨.
|
|
@@ -182,7 +181,7 @@ _⚠️ Only `.storyboard` files are supported ([Apple has deprecated other m
|
|
|
182
181
|
|
|
183
182
|
---
|
|
184
183
|
|
|
185
|
-
Edit the `ios/YourProjectName/AppDelegate.
|
|
184
|
+
Edit the `ios/YourProjectName/AppDelegate.m(m)` file:
|
|
186
185
|
|
|
187
186
|
```obj-c
|
|
188
187
|
#import "AppDelegate.h"
|
|
@@ -238,7 +237,7 @@ dependencies {
|
|
|
238
237
|
// …
|
|
239
238
|
|
|
240
239
|
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
|
|
241
|
-
implementation "androidx.core:core-splashscreen:1.0.0
|
|
240
|
+
implementation "androidx.core:core-splashscreen:1.0.0" // Add this line
|
|
242
241
|
|
|
243
242
|
// …
|
|
244
243
|
```
|
|
@@ -286,24 +285,20 @@ dependencies {
|
|
|
286
285
|
5. Finally edit your `android/app/src/main/java/com/yourprojectname/MainActivity.java` file:
|
|
287
286
|
|
|
288
287
|
```java
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
import
|
|
288
|
+
// …
|
|
289
|
+
|
|
290
|
+
// Add these required imports:
|
|
291
|
+
import android.os.Bundle;
|
|
292
|
+
import com.zoontek.rnbootsplash.RNBootSplash;
|
|
293
293
|
|
|
294
294
|
public class MainActivity extends ReactActivity {
|
|
295
295
|
|
|
296
296
|
// …
|
|
297
297
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
//
|
|
301
|
-
|
|
302
|
-
@Override
|
|
303
|
-
protected void loadApp(String appKey) {
|
|
304
|
-
RNBootSplash.init(getPlainActivity()); // <- initialize the splash screen
|
|
305
|
-
super.loadApp(appKey);
|
|
306
|
-
}
|
|
298
|
+
@Override
|
|
299
|
+
protected void onCreate(Bundle savedInstanceState) {
|
|
300
|
+
RNBootSplash.init(this); // <- initialize the splash screen
|
|
301
|
+
super.onCreate(savedInstanceState); // or super.onCreate(null) with react-native-screens
|
|
307
302
|
}
|
|
308
303
|
}
|
|
309
304
|
```
|
|
@@ -387,7 +382,6 @@ function App() {
|
|
|
387
382
|
}
|
|
388
383
|
```
|
|
389
384
|
|
|
390
|
-
|
|
391
385
|
## With react-native-bars
|
|
392
386
|
|
|
393
387
|
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.
|
package/android/build.gradle
CHANGED
|
@@ -49,5 +49,5 @@ repositories {
|
|
|
49
49
|
dependencies {
|
|
50
50
|
//noinspection GradleDynamicVersion
|
|
51
51
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
52
|
-
implementation "androidx.core:core-splashscreen:${safeExtGet("androidXSplashScreenVersion", "1.0.0
|
|
52
|
+
implementation "androidx.core:core-splashscreen:${safeExtGet("androidXSplashScreenVersion", "1.0.0")}"
|
|
53
53
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-bootsplash",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.1",
|
|
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.5",
|
|
75
|
+
"lint-staged": "^13.0.3",
|
|
76
76
|
"prettier": "^2.7.1",
|
|
77
|
-
"prettier-plugin-organize-imports": "^3.0.
|
|
77
|
+
"prettier-plugin-organize-imports": "^3.0.3",
|
|
78
78
|
"react": "^18.0.0",
|
|
79
|
-
"react-native": "^0.69.
|
|
79
|
+
"react-native": "^0.69.4",
|
|
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),
|