Skip to content
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

WindowInsets.statusBars in version 1.5.10 #3901

Closed
k-kertykamary opened this issue Nov 4, 2023 · 4 comments
Closed

WindowInsets.statusBars in version 1.5.10 #3901

k-kertykamary opened this issue Nov 4, 2023 · 4 comments
Labels

Comments

@k-kertykamary
Copy link

Hello :),

With the following dependency versions:

kotlin.version=1.9.10
agp.version=8.1.2
compose.version=1.5.3

I observe the following behavior:

val top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding()
println("TOP == $top")
=====> 59.dp (on iOS)

However, when you switch to the following dependency versions:

kotlin.version=1.9.20
agp.version=8.1.2
compose.version=1.5.10

The behavior changes to:

val top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding()
println("TOP == $top")
=====> 0.dp (on iOS)

@k-kertykamary k-kertykamary added bug Something isn't working submitted labels Nov 4, 2023
@MatkovIvan
Copy link
Member

Hi @k-kertykamary,

Just re-checked - it works as expected. You probably trying to get it inside Popup/Dialog. In the last version, we fixed the behavior of WindowInsets inside Popup/Dialog - it zeroed to avoid double application and match Android behavior now.

Closing this for now, but if it's not your case, please let me know.

@MatkovIvan MatkovIvan added ios and removed bug Something isn't working submitted labels Nov 6, 2023
@k-kertykamary
Copy link
Author

Hi @MatkovIvan ,
Thank's !!! :)
Yes, that's right. I'm trying to add a top padding to a Row with that value in a Popup.
If it's reset to zero in the new version, how can I retrieve that value in iOS ? Thank you

@MatkovIvan
Copy link
Member

Popup is inside safe area by default, you don't need to add this padding explicitly. That's why it is zero now.

how can I retrieve that value in iOS

As I said, you probably don't need to do that - WindowInsets is not simple constant padding; it has de-duplication logic under the hood. But if you really need that, you can use the same method as on Android - just read the value outside Popup but apply inside. In this case, you most likely are using the wrong tools to achieve your goal. Could you please describe your use case?

@okushnikov
Copy link
Collaborator

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants