Giter Club home page Giter Club logo

Comments (26)

dhruv-00 avatar dhruv-00 commented on May 12, 2024 1

No I did not change any windows flags

from react-native-unistyles.

jpudysz avatar jpudysz commented on May 12, 2024 1

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.

jpudysz avatar jpudysz commented on May 12, 2024 1

It was not addressed specifically for this issue. I will debug this report tomorrow with OnePlus device 🙏

from react-native-unistyles.

dhruv-00 avatar dhruv-00 commented on May 12, 2024 1

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.

jpudysz avatar jpudysz commented on May 12, 2024 1

Reproduced!

image

from react-native-unistyles.

jpudysz avatar jpudysz commented on May 12, 2024 1

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.

dhruv-00 avatar dhruv-00 commented on May 12, 2024

WhatsApp Image 2024-03-29 at 4 08 18 PM
https://github.com/jpudysz/react-native-unistyles/assets/86352938/111398c6-db21-44a6-b6f8-9d
Screenshot 2024-03-29 at 4 06 52 PM
Screenshot 2024-03-29 at 4 07 14 PM

6f561ad6dd

from react-native-unistyles.

jpudysz avatar jpudysz commented on May 12, 2024

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.

dhruv-00 avatar dhruv-00 commented on May 12, 2024

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.

dhruv-00 avatar dhruv-00 commented on May 12, 2024

after setting status bar translucent
WhatsApp Image 2024-03-29 at 5 10 15 PM

from react-native-unistyles.

jpudysz avatar jpudysz commented on May 12, 2024

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.

dhruv-00 avatar dhruv-00 commented on May 12, 2024

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.

jpudysz avatar jpudysz commented on May 12, 2024

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.

jpudysz avatar jpudysz commented on May 12, 2024

I will be able to get OnePlus with Android 14 on Tuesday (after Easter). I will debug it directly 🙏

from react-native-unistyles.

efstathiosntonas avatar efstathiosntonas commented on May 12, 2024

@jpudysz 2.5.2 fixes this or it's unrelated?

from react-native-unistyles.

jpudysz avatar jpudysz commented on May 12, 2024

Hey @dhruv-00 can you check how it works with fresh release (2.5.2 )?

from react-native-unistyles.

dhruv-00 avatar dhruv-00 commented on May 12, 2024

let me check I'll update you

from react-native-unistyles.

dhruv-00 avatar dhruv-00 commented on May 12, 2024

@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.

jpudysz avatar jpudysz commented on May 12, 2024

Ok thanks for the tests. Tomorrow, I will setup deeplinking and try to repro it with OnePlus 🙏

from react-native-unistyles.

jpudysz avatar jpudysz commented on May 12, 2024

Tested on OnePlus 9 Pro with Android 14.

  1. Opening app from killed state with deeplinking:
npx uri-scheme open unistyles:// --android

Shows always top=0.

  1. 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.

dhruv-00 avatar dhruv-00 commented on May 12, 2024

On which react native version you are trying it?

from react-native-unistyles.

jpudysz avatar jpudysz commented on May 12, 2024

0.74-rc.5 and 0.73.6 in your example

from react-native-unistyles.

jpudysz avatar jpudysz commented on May 12, 2024

Tried your example with 0.72.6:

image

hmm, any ideas whats different in your app?

EDIT:

same output with:

npx uri-scheme open unistyles:// --android

from react-native-unistyles.

jpudysz avatar jpudysz commented on May 12, 2024

Ok, so I need to setup Firebase project 🫡

from react-native-unistyles.

dhruv-00 avatar dhruv-00 commented on May 12, 2024

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.

jpudysz avatar jpudysz commented on May 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.