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
top insets wrong value not same as safe area insets #170
Comments
Hello 👋 But what is the issue? That unistyles is not showing exact same values as On your example status bar is translucent or not? If not then indeed it's a bug, if it is then Unistyles reports correct value = 46. What's your phone model / android version? Also please take a look here: https://www.unistyl.es/reference/dimensions/#insets |
the issue is that normally it is working fine but when the app is in killed state and I open it with notification then the top value is not proper. phone: OnPlus 12 / Android 14 |
Ok, so you don't have satus bar translucent, and it happens only if you open the app from push notification? |
yes exactly, and my main app is react-native 0.72.6 |
Ok to sum it up: Android 14 with RN 0.73, Unistyles 2.5.1, when you open fresh app you're receiving invalid top inset (but not always). So the last question: |
No I did not change any windows flags |
Cool, thanks for the report. I'm a little bit surprised as Android 14 has a stable inset API. Maybe it's something about OnePlus |
I will be able to get OnePlus with Android 14 on Tuesday (after Easter). I will debug it directly 🙏 |
It was not addressed specifically for this issue. I will debug this report tomorrow with OnePlus device 🙏 |
Hey @dhruv-00 can you check how it works with fresh release (2.5.2 )? |
let me check I'll update you |
@jpudysz I'm not able to reproduce in the example I provided but in my main app which is using react native "0.72.6" normally it is working but when app is opened from notification in kill state it is still providing wrong value |
Ok thanks for the tests. Tomorrow, I will setup deeplinking and try to repro it with OnePlus 🙏 |
Tested on OnePlus 9 Pro with Android 14.
Shows always
<StatusBar translucent /> (NOBRIDGE) LOG Bridgeless mode is enabled
(NOBRIDGE) LOG Running "bare" with {"rootTag":51,"initialProps":{},"fabric":true}
(NOBRIDGE) LOG UnistylesRuntime.insets: 0
(NOBRIDGE) LOG UnistylesRuntime.insets: 32 But it's because Any other idea how can I test it? |
On which react native version you are trying it? |
0.74-rc.5 and 0.73.6 in your example |
first one is with notification and second one is with uri scheme |
Ok, so I need to setup Firebase project 🫡 |
Are there any steps by which I can debug this? |
You would need to debug kotlin files.. |
That was extremely difficult to spot, but thanks to you, Unistyles can now properly initialize in headless mode. The issue was that layout listeners were not being properly set when the app was initializing from headless mode, e.g. from a push notification. You should now receive the correct value. Disclaimer: I will release Unistyles 2.5.3 soon 🎉 |
Description
The insets value of top is showing wrong it is not same as useSafeAreaInsets some times it shows fine and some time when app is opened with killed state notificaion
Steps to reproduce
create new react native app install unistyles and safe area context match both insets value it will be different check in the repro
Snack or a link to a repository (optional)
https://github.com/dhruv-00/unistyles-repro
Unistyles version
2.5.1
React Native version
0.73.6
Platforms
Android
Engine
JSC
Architecture
Paper (old)
The text was updated successfully, but these errors were encountered: