-
-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v5 - Bye AndroidX, dark mode + brand image support, useHideAnimation hook, etc. #475
Conversation
@MasonLe2497 No, you can only set a colour for the background in Android 12+, nothing more: https://developer.android.com/reference/android/R.attr#windowSplashScreenBackground |
@MasonLe2497 No, you can only use properties specified in the migration guide / v5 README. @liamjones is right, only color can be used as background on Android 12+. |
hi,
No file was created inside drawable.
|
@sssajjad007 Update to latest v5 beta, don't forget to run npm install / yarn install. |
Yes, I did the same, also ./gradlew clean there is repo & output files : |
@sssajjad007 I just cloned your project, ran the exact same command, it's correctly outputed files in |
@zoontek but i use command without --platform and its work, i think the problem is with my terminal. |
@sssajjad007 100% normal,
|
you have plan to merge pr to prod bro ? |
@nhutph When stable version is released. But you can fully access the v5 README, install the RC ( |
Greate!!! |
👋 Hi folks!
This PR has been opened to track the development of the next major version: v5 ✨
It's the result of several months of work (I'm working on it on my free time only) and includes a lot!
What's new
Bye AndroidX 👋
v4 introduced the usage of the official Android SplashScreen API with
androidx.core:core-splashscreen
in order to support Android 12+. But this change came with a lot of issues (#381, #418, #440, #456, etc.), and those issues seem to be ignored on the Google issue tracker. The next version now uses its own polyfill, compatible with Android 5+ (without any degraded mode, compared to the AndroidX one).Dark mode 🌚
The generator is now able to output a lot more files, including dark mode versions of all the splash screen assets (in all required pixel densities, but also config files, etc.)
The update is simple: run the generator, drag and drop the newly created
Colors.xcassets
in your Xcode project, done!Brand image support 🏢
Dropping AndroidX was also necessary to add brand images support on Android 5+ as the feature wasn't polyfilled (and
android:windowSplashScreenBrandingImage
is only available on Android 12+).You can finally tell your boss that the company logo will be visible at app opening 🧑💼
An updated CLI 🧑💻
In order to support all these new features, I had to publish an updated CLI generator. By default, it will be as capable as the previous one (android, iOS and the assets directory). The only new emitted file is the manifest (for
useHideAnimation
usage). But in order to to use the--brand
,--brand-width
and--dark-*
options, you must specify a--license-key
🔑With it, the generator is able to output over 50 files (logo and brand images generated in all pixel densities, dark mode versions, etc.), saving you (and your company!) a massive amount of time not only at creation, but also at each adjustment.
I know, free software is always better. But I think it's a good way to make the development of this library (and indirectly,
react-native-permissions
andreact-native-localize
) sustainable.Monetizing open source is a hard task and I'm really glad a few individuals and companies are sponsoring my work, but unfortunately it's not systematic yet for companies to give a bit, even if their products are often built using free open source maintainers work.
❗️ Important: If you are currently sponsoring me, or sponsored me once in the past, contact me to get a free license key. It could have been any amount, even only 1$ for a coffee ☕️
👉 You can buy a license on Gumroad
useHideAnimation 🫣
You always wanted a custom hide animation, similar to the one in the example project?
useHideAnimation
is a new hook that will help you creating one, in the easiest way possible.How does it work? First, run the generator with the
--assets-output
option. Once the files are ready, create a custom splash screen:Then uses it:
useHideAnimation.usage.mp4
Other changes
Theme.BootSplash
,bootSplashBackground
,bootSplashLogo
,bootSplashBrand
andpostBootSplashTheme
.mipmap-*
directories todrawable-*
ones.duration
argument has been removed fromfade()
options.bootsplash_manifest.json
file to share image sizes + colors with the JS thread (used byuseHideAnimation
).getVisibilityStatus()
has been replaced withisVisible()
(which returns aPromise<boolean>
). Thetransitioning
does not exists anymore (when the splash screen is fading, it staysvisible
until complete disappearance).--assets-path
CLI option has been renamed--assets-output
.How to try it
@next
version:$ npm install --save react-native-bootsplash@next # --- or --- $ yarn add react-native-bootsplash@next
What's next?
show
method and I personally think it's not a good idea, as calling the splash screen back is not really what we can call good UX.The goal of this library will be allowing you to design multiple covers screen (ex: for OTA update, for privacy when the app is in multi task), each ones with its own design.