-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Animate splash screen #17477
Merged
Merged
Animate splash screen #17477
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
e5341e7
Switch Android to promises queue + remove fade
zoontek cd83444
Animate splash screen in JS
zoontek 6bd38c8
Generate new assets (previous were 1px off)
zoontek c22765a
Add iOS support
zoontek a47a79d
Tweak the animation
zoontek 76e8729
Export to styles
zoontek 75a8ca3
Tweak values
zoontek 29785af
Tweak values
zoontek d24eeee
Don't apply negative margin on other platforms than Android
zoontek b9f849b
Tweak animations values
zoontek 809f5c9
Add a comment
zoontek 4842634
Don't run staggering animations
zoontek 6d2f66e
Handle visibility in parent component
zoontek 78196fa
Use @color/status_bar_background
zoontek d95c1a0
Remove Platform.OS usage
zoontek 8e86ce1
Publish shrinking animation
zoontek 3868784
Fix linting
zoontek f956e8a
AnimatedSplashScreen -> SplashScreenHider
zoontek be9b588
Remove Platform usage
zoontek 0def2a1
Fix linting
zoontek 34a305b
Fix CSP issue by inlining CSS + logo and hide once the bundle is loaded
zoontek 961f452
Remove extra logic
zoontek 710f955
Run prettier
zoontek aa6010f
Resolve with a Promise
zoontek eba16b2
Replace .web by .native
zoontek cc6928a
Remove RCT_REMAP_METHOD
zoontek 01711d2
Fix splash screen re-rendered on login / logout
zoontek 5e51f05
Merge branch 'main' into animate-splash-screen
zoontek 2b892bf
Merge branch 'main' into animate-splash-screen
zoontek 3edb908
Switch to reanimated
zoontek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,42 @@ | ||
import Log from '../Log'; | ||
|
||
let areFontsReady = false; | ||
document.fonts.ready.then(() => { | ||
areFontsReady = true; | ||
}); | ||
|
||
function hide() { | ||
Log.info('[BootSplash] hiding splash screen', false); | ||
|
||
return new Promise((resolve) => { | ||
const minMilisecondsToWait = 1.5 * 1000; | ||
let passedMiliseconds = 0; | ||
let isRootMounted = false; | ||
const root = document.getElementById('root'); | ||
const splash = document.getElementById('splash'); | ||
|
||
const intervalId = setInterval(() => { | ||
passedMiliseconds += 250; | ||
isRootMounted = root.children.length > 0; | ||
if (passedMiliseconds >= minMilisecondsToWait && isRootMounted && areFontsReady) { | ||
clearInterval(intervalId); | ||
splash.style.opacity = 0; | ||
|
||
setTimeout(() => { | ||
splash.parentNode.removeChild(splash); | ||
resolve(); | ||
}, 250); | ||
} | ||
}, 250); | ||
}); | ||
} | ||
|
||
function getVisibilityStatus() { | ||
return document.getElementById('splash') ? 'visible' : 'hidden'; | ||
} | ||
|
||
export default { | ||
hide: () => Promise.resolve(), | ||
getVisibilityStatus: () => Promise.resolve('hidden'), | ||
hide, | ||
getVisibilityStatus, | ||
navigationBarHeight: 0, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line caused a bug to arise, resulting in a regression in #19777. We should have verified that the storybook builds and runs successfully.