Comments (26)
No I did not change any windows flags
from react-native-unistyles.
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
from react-native-unistyles.
It was not addressed specifically for this issue. I will debug this report tomorrow with OnePlus device 🙏
from react-native-unistyles.
first one is with notification and second one is with uri scheme
https://github.com/jpudysz/react-native-unistyles/assets/86352938/942aee07-4b4c-4a01-8280-933a5d2cb8c5
from react-native-unistyles.
Reproduced!
from react-native-unistyles.
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:
Unistyles will emit two insets events when run in headless mode, but this should not be visible to the end user.
It's possible to emit a single event, but I need to refactor how the C++ module works, so most likely, this will be implemented in Unistyles 3.0.
I will release Unistyles 2.5.3 soon 🎉
from react-native-unistyles.
https://github.com/jpudysz/react-native-unistyles/assets/86352938/111398c6-db21-44a6-b6f8-9d
6f561ad6dd
from react-native-unistyles.
Hello 👋
But what is the issue? That unistyles is not showing exact same values as safe-area-context
?
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?
What's your setup, do you use expo? Do you use any windows flags?
If you want me to help I need a lot more details.
Also please take a look here: https://www.unistyl.es/reference/dimensions/#insets
from react-native-unistyles.
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.
In my main app the issue is coming when opening with notification
when I tried to create it with new reproducible example then it was already showing wrong value in the first time without notification opening
phone: OnPlus 12 / Android 14
react native cli
from react-native-unistyles.
after setting status bar translucent
from react-native-unistyles.
Ok, so you don't have satus bar translucent, and it happens only if you open the app from push notification?
from react-native-unistyles.
yes exactly, and my main app is react-native 0.72.6
but in the reproducible example it is latest version and it is reproducible without opening the notification
from react-native-unistyles.
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).
You're not using expo.
So the last question:
Did you modify anyhow window flags? Example is in the documentation posted above.
from react-native-unistyles.
I will be able to get OnePlus with Android 14 on Tuesday (after Easter). I will debug it directly 🙏
from react-native-unistyles.
@jpudysz 2.5.2 fixes this or it's unrelated?
from react-native-unistyles.
Hey @dhruv-00 can you check how it works with fresh release (2.5.2 )?
from react-native-unistyles.
let me check I'll update you
from react-native-unistyles.
@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
from react-native-unistyles.
Ok thanks for the tests. Tomorrow, I will setup deeplinking and try to repro it with OnePlus 🙏
from react-native-unistyles.
Tested on OnePlus 9 Pro with Android 14.
- Opening app from killed state with deeplinking:
npx uri-scheme open unistyles:// --android
Shows always top=0
.
- I was able to reproduce double reporting with:
<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 StatusBar
is rendered in JSX, so it happends after first re-render.
Any other idea how can I test it?
from react-native-unistyles.
On which react native version you are trying it?
from react-native-unistyles.
0.74-rc.5 and 0.73.6 in your example
from react-native-unistyles.
Tried your example with 0.72.6:
hmm, any ideas whats different in your app?
EDIT:
same output with:
npx uri-scheme open unistyles:// --android
from react-native-unistyles.
Ok, so I need to setup Firebase project 🫡
from react-native-unistyles.
Are there any steps by which I can debug this?
may be looking into any specific files.
which you think might be causing the issue.
from react-native-unistyles.
You would need to debug kotlin files..
Let me firstly try with some push notification. I just hope I will be able to repro and isolate the issue
from react-native-unistyles.
Related Issues (20)
- Wrong styles type provided by useStyles which has stylesheet with Platfrom.select(...) HOT 6
- [iOS] UnistylesRuntime.screen.height return value equal to width HOT 3
- Breakpoint not hydrated after SSR render HOT 1
- [android]: adaptive themes not updates on start HOT 6
- Can not be downloaded from yarn registry HOT 2
- Not Working In Chrome Debugger HOT 1
- [2.3.0] java.lang.UnsatisfiedLinkError HOT 14
- [android] Throwing new exception HOT 10
- Hot reloading with custom plugins throws error HOT 2
- I got an error on my APK build HOT 3
- Unistyles runtime is not available. Make sure you followed the installation instructions HOT 5
- fontVariant doesn't work HOT 5
- Fatal Exception: java.lang.UnsatisfiedLinkError HOT 6
- Attempt to invoke virtual method 'int android.view.WindowInsets.getSystemWindowInsetTop()' on a null object reference HOT 4
- UnistylesRuntime.updateTheme doesn't trigger rerender on React Native Web HOT 3
- theme param in createStylesheet's callback is empty object on web with react-native-web HOT 8
- Incorrect bottom inset (Android) HOT 17
- UnistylesRegistry breaks test with barrel files HOT 1
- plugins : autoGuidelinePlugin HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-unistyles.