Fork of CLI for generating assets for react-native-bootsplash.
npm install react-native-bootsplash-cli-fork




This is a fork of react-native-bootsplash CLI.
Fork allows generating dark mode splash screens.
Fork is based on original react-native-bootsplash CLI with following changes:
- New parameter: --dark-logo [path], allows to specify different logo for dark mode themes
- New parameter: --dark-background-color [color], allows to specify different background color for dark mode themes
Note: this is NOT a fork/replacement of react-native-bootsplash itself! You still need to install and configure react-native-bootsplash according to instructions.
This library could be used as a replacement of Assets generation
step.
``bash`
$ npm install --save-dev react-native-bootsplash-cli-fork--- or ---
$ yarn add -D react-native-bootsplash-cli-fork
CLI could generate assets, create the Android Drawable XML file and the iOS Storyboard file automatically ✨.
`bash`
$ npx react-native generate-bootsplash-fork --help--- or ---
$ yarn react-native generate-bootsplash-fork --help
The command can take multiple arguments:
`bash
yarn react-native generate-bootsplash-fork
Generate a launch screen using an original logo file
Options:
--background-color
--logo-width
--assets-path [path] path to your static assets directory (useful to require the logo file in JS)
--flavor
--dark-logo [path] [optional] if specified, will be used for splashscreen that is shown when phone is in dark mode
--dark-background-color
-h, --help output usage information
`
#### Full command usage example
`bash`
yarn react-native generate-bootsplash assets/bootsplash_logo_original.png \
--background-color=F5FCFF \
--dark-logo=assets/bootsplash_logo_dark.png \
--logo-width=100 \
--assets-path=assets \
--flavor=main
This tool generates assets that could later be used by react-native-bootsplash:
`bashOnly if --assets-path was specified
assets/bootsplash_logo.png
assets/bootsplash_logo@1,5x.png
assets/bootsplash_logo@2x.png
assets/bootsplash_logo@3x.png
assets/bootsplash_logo@4x.pngif dark logo is specified
assets/bootsplash_logo_dark.png
assets/bootsplash_logo_dark@1,5x.png
assets/bootsplash_logo_dark@2x.png
assets/bootsplash_logo_dark@3x.png
assets/bootsplash_logo_dark@4x.png
android/app/src/main/res/values/colors.xml (creation and addition)
android/app/src/main/res/values-night/colors.xml
android/app/src/main/res/mipmap-hdpi/bootsplash_logo.png
android/app/src/main/res/mipmap-mdpi/bootsplash_logo.png
android/app/src/main/res/mipmap-xhdpi/bootsplash_logo.png
android/app/src/main/res/mipmap-xxhdpi/bootsplash_logo.png
android/app/src/main/res/mipmap-xxxhdpi/bootsplash_logo.png
ios/YourProjectName/BootSplash.storyboard
ios/YourProjectName/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo.png
ios/YourProjectName/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo@2x.png
ios/YourProjectName/Images.xcassets/BootSplashLogo.imageset/bootsplash_logo@3x.png
If you want to have different splashscreen in Dark Mode, also create/edit the
android/app/src/main/res/values-night/styles.xml:`xml
``