-
-
Notifications
You must be signed in to change notification settings - Fork 521
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
feat: add visionOS support #2025
Conversation
@okwasniewski Hi there, thank you for this PR! 🎉
8mb.video-WD2-m2XIZwK3.mp4
8mb.video-M7Q-pq1t4gem.mp4
Screen.Recording.2024-02-12.at.18.44.51.movAnd I think that's mostly all! Beside those things, I am quite astonished that screen animations and search bar actually works! Great job! |
Hey @tboba, Thanks for taking the time to check this PR. It would be great if you could share the repo 🙏 |
@okwasniewski cool! Here's the repo: https://github.com/tboba/screens-visionos-example |
visionOS doesn't have status bar so I added ifdefs to this method 😅 The error might be silenced after adding this key to Info.plist but I don't think it makes sense to show this warning. I saw the same behaviour in RN Core - Im not sure why it is showing this way but it looks more like a bug in visionOS than in screens. Let's leave it as is for now and adjust when/if Apple provides a better way to do it. Hah this is interesting, I think Apple didn't intended to change for visionOS.. Maybe we can show a warning when user attempts to change it? |
@okwasniewski I'm concerned if we should allow changing the header's style by clicking (or tapping? I only heard that the visionOS's cursor is being controlled by the eye :D) on it at all 😅 |
@tboba I meant we should ignore changing header color for visionOS (it should be always set to white). I guess what's happening is that the view refreshes when the user taps on it. Let's show warning or just ignore changing color when someone (developer) attempts to change it. |
@okwasniewski, yeah, I would also assume that 😄 |
@tboba I added ifdefs to ignore changing the header title color, I found that adding warnings was really annoying as they were triggered all the time - I think it will be worth adding to documentation that changing color is ignored for this platform |
@okwasniewski hmm, on the JS side we have the package with |
1167e24
to
0081858
Compare
@tboba I've added |
0081858
to
96d4c45
Compare
@tboba Not sure why Android e2e is failing but it looks like a flaky e2e test |
@okwasniewski Yup, unfortunately Github Runners are not that performant to assert that some of the components from the example are visible, resulting in test fails 😕 I'll run this test once or twice and it should be green! |
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.
Looks good to me, thanks!
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.
LGTM!
## Description This PR adds visionOS support. Changes are mostly around the same places where tvOS had `ifdefs`. ## Changes - Added `visionos` support ## Screenshots / GIFs https://github.com/software-mansion/react-native-screens/assets/52801365/7618d537-1e31-4cde-9610-da109295d800 ## Test code and steps to reproduce 1. I've initialized new visionOS project inside of the repo and linked it (same as TVOS example) 2. `react-native-safearea-context` supports visionOS from version `4.9.0` _Note: I didn't add new visionOS example (as they are many of them already) but soon `react-native-test-app` will support visionOS so that might be a solution to test visionOS in the long run_ ## Checklist - [x] Ensured that CI passes
Description
This PR adds visionOS support. Changes are mostly around the same places where tvOS had
ifdefs
.Changes
visionos
supportScreenshots / GIFs
CleanShot.2024-01-30.at.15.59.15.mp4
Test code and steps to reproduce
react-native-safearea-context
supports visionOS from version4.9.0
Note: I didn't add new visionOS example (as they are many of them already) but soon
react-native-test-app
will support visionOS so that might be a solution to test visionOS in the long runChecklist