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

Fix applying WindowInsets inside Popup/Dialog #832

Merged
merged 4 commits into from
Sep 21, 2023

Conversation

MatkovIvan
Copy link
Member

@MatkovIvan MatkovIvan commented Sep 20, 2023

Proposed Changes

  • Unwrap unnecessary state for LocalSafeArea/LocalLayoutMargins
  • Override LocalSafeArea/LocalLayoutMargins for separate owners.
  • Replace IOSInsets to PlatformInsets - Don't use data classes in an API

Changes in API

-androidx.compose.ui.uikit.IOSInsets
+androidx.compose.ui.platform.PlatformInsets
-androidx.compose.ui.uikit.LocalSafeAreaState
+androidx.compose.ui.platform.LocalSafeArea
-androidx.compose.ui.uikit.LocalLayoutMarginsState
+androidx.compose.ui.platform.LocalLayoutMargins

Testing

Box(modifier = Modifier
    .fillMaxSize()
    .windowInsetsPadding(WindowInsets.systemBars)
    .background(Color.Green)
)
Popup {
    Box(modifier = Modifier
        .fillMaxSize()
        .windowInsetsPadding(WindowInsets.systemBars)
        .background(Color.Red)
    )
}
Android iOS (Before) iOS (After)

Issues Fixed

Fixes (partially) JetBrains/compose-multiplatform#3701

@MatkovIvan MatkovIvan merged commit 2be70cf into jb-main Sep 21, 2023
3 checks passed
@MatkovIvan MatkovIvan deleted the ivan.matkov/fix-popup-insets branch September 21, 2023 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants