-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Fix StatusBar on Android API 30 #33058
Conversation
@ShikaSD has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
// Although systemUiVisibility is deprecated in API 30, insetsController doesn't work | ||
// reliably and both mechanisms can affect the style. It works properly in API 31, so | ||
// use both mechanisms on API 30 only. | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) { |
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.
Can we just do Build.VERSION.SDK_INT > Build.VERSION_CODES.R
instead? Why use both ways at the same time?
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.
Good question. I wasn't confident that even though the new way didn't appear to work on API 30 for me that it still wasn't doing something.
Changing to >
would be cleaner and I can do that if you prefer.
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.
I thought about it and went ahead and updated it to just >
.
737b513
to
d236bc6
Compare
Base commit: cd79317 |
Base commit: cd79317 |
@ShikaSD has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @ieatfood in 9ed2df6. When will my fix make it into a release? | Upcoming Releases |
Summary: In facebook#32975 I implemented the new `insetsController#setSystemBarsAppearance` interface, but I found that on Android 11 (API 30) it doesn't appear to work which I missed in earlier testing. It works correctly on Android 12 and the deprecated `systemUiVisibility` interface still works fine on Android 11, so I'm having Android 11 use the deprecated mechanism. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [Android] [Fixed] - Fix StatusBar on Android API 30 Pull Request resolved: facebook#33058 Test Plan: Tested in `rn-tester` on simulators using Android 9, 10, 11, 12, and on an Android 9 device. Reviewed By: lunaleaps Differential Revision: D34050025 Pulled By: ShikaSD fbshipit-source-id: ad80fae1446aca368b09df810785a1cc38383450
Summary
In #32975 I implemented the new
insetsController#setSystemBarsAppearance
interface, but I found that on Android 11 (API 30) it doesn't appear to work which I missed in earlier testing. It works correctly on Android 12 and the deprecatedsystemUiVisibility
interface still works fine on Android 11, so I'm having Android 11 use the deprecated mechanism.Changelog
[Android] [Fixed] - Fix StatusBar on Android API 30
Test Plan
Tested in
rn-tester
on simulators using Android 9, 10, 11, 12, and on an Android 9 device.