-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Android: useAnimatedKeyboard listener breaks translucent StatusBar + NavigationBar #3631
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
Comments
FYI: From my basic investigation I think the following lines may be the culprit I tried to clone, fix and build, but I think there is something different about the build process of 2.10.0 where remote sources/binaries are included. If someone were to explain how to disable this to me, I'd be happy to implement a check to store the initial value and return it to that, rather than |
There are many things connected to this. Are you using expo or expo-dev-client? Are you using react-native-screens and the native stack? If so, make sure you're at minimum version 3.14+. There are still some cases were the old deprecated I am using https://github.com/kirillzyusko/react-native-keyboard-controller, which provides basically the same hook. @kirillzyusko and I spent a ton of time to track down this issues and his library also exposes a statusBarTranslucent prop on the provider to fix all of this weird issues. You could give it a try. |
I'll do that and report back, though would love to see this resolved in reanimated, as I like to keep my dependencies as few as possible. |
@hirbod Sorry, forgot to update! Your provided solution worked perfectly, thanks for your help. Going to leave this issue open, so when the RNR team get round to it they have a summary & repro of the issue for their own hook. |
I have the same bug. Here is a reproducible code snippet. I'm using the latest RN (0.70.4) and reanimated (2.12.0)
|
Hey, could someone confirm if this PR - #3958 fix the problem? |
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please follow the template so that the reviewers can easily understand what the code changes affect. --> ## Summary Fixes #3631 Fixes the issue with translucent StatusBar on Android by adding the option `isStatusBarTranslucentAndroid` in `useAnimatedKeyboard`. It is the same solution as the one mentioned in the issue: kirillzyusko/react-native-keyboard-controller@2a7c92f ## Test plan There is an excellent example in the issue that reproduces the problem: https://github.com/ChildishForces/reanimated-bug-repro I tested on real Android device with Android 12 and RN 71. I think it would be nice to also test on RN < 70 because the bottom padding may behave differently.
@piaskowyk I don't think this PR completely fixed the issue. For more info please see the bug report here #4277 . |
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please follow the template so that the reviewers can easily understand what the code changes affect. --> ## Summary Fixes software-mansion#3631 Fixes the issue with translucent StatusBar on Android by adding the option `isStatusBarTranslucentAndroid` in `useAnimatedKeyboard`. It is the same solution as the one mentioned in the issue: kirillzyusko/react-native-keyboard-controller@2a7c92f ## Test plan There is an excellent example in the issue that reproduces the problem: https://github.com/ChildishForces/reanimated-bug-repro I tested on real Android device with Android 12 and RN 71. I think it would be nice to also test on RN < 70 because the bottom padding may behave differently.
Uh oh!
There was an error while loading. Please reload this page.
Description
When using
useAnimatedKeyboard
applications that take advantage of the full screen by using translucent (absolutely positioned) StatusBar and NavigationBar revert to having solid counterparts. (Full reproduction repo below, no need to follow the steps)Steps to reproduce
MainActivity.java
:onCreate
:useAnimatedKeyboard
and the insets will disappear.Snack or a link to a repository
https://github.com/ChildishForces/reanimated-bug-repro
Reanimated version
2.10.0
React Native version
0.69.0
Platforms
Android
JavaScript runtime
Hermes
Workflow
Expo bare workflow
Architecture
Paper (Old Architecture)
Build type
Debug mode
Device
Real device
Device model
OnePlus 9 Pro
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: