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

Insets on iOS #577

Merged
merged 32 commits into from
May 26, 2023
Merged

Insets on iOS #577

merged 32 commits into from
May 26, 2023

Conversation

dima-avdeev-jb
Copy link

@dima-avdeev-jb dima-avdeev-jb commented May 23, 2023

Added WindowInsets to iOS

*/
val WindowInsets.Companion.systemGestures: WindowInsets
@Composable
get() = layoutMargins // the same as iosSafeArea.add(WindowInsets(left = 16.dp, right = 16.dp))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, it's better to recheck this. Probably const is better

Copy link
Author

@dima-avdeev-jb dima-avdeev-jb May 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think that it may be better for performance reasons?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not about performans, but about possible change in future

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can postpone it

import androidx.compose.ui.main.defaultUIKitMain
import androidx.compose.ui.window.ComposeUIViewController

fun main() {
defaultUIKitMain("ComposeDemo", ComposeUIViewController {
val app = remember { App() }
app.Content()
IosDemo()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In mpp we usually add some new sample as a page. Why it cannot be done in this way?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compose Multiplatform Demo already has Scaffold with smaller area of content. For Insets sample, we need fullscreen access.

} ?: error("Can't find orientation rawValue $orientation in enum InterfaceOrientation")
}

fun getStatusBarOrientation(): InterfaceOrientation =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add comments/docs for public API

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

dima-avdeev-jb and others added 5 commits May 25, 2023 19:09
…oidx/compose/foundation/layout/WindowInsets.uikit.kt

Co-authored-by: Ivan Matkov <ivan.matkov@jetbrains.com>
…oidx/compose/foundation/layout/WindowInsets.uikit.kt

Co-authored-by: Ivan Matkov <ivan.matkov@jetbrains.com>
…oidx/compose/foundation/layout/WindowInsets.uikit.kt

Co-authored-by: Ivan Matkov <ivan.matkov@jetbrains.com>
@dima-avdeev-jb dima-avdeev-jb merged commit 4ddcf93 into jb-main May 26, 2023
@dima-avdeev-jb dima-avdeev-jb deleted the uikit-inset-safe-area branch May 26, 2023 12:28
igordmn pushed a commit that referenced this pull request Jul 10, 2023
Test: ./gradlew test connectedCheck
Bug: 270612487

This is an imported pull request from androidx#577.

Resolves #577
Github-Pr-Head-Sha: 62541e8
GitOrigin-RevId: 4918bcf

Change-Id: Ie1d1b4ce9aabfeb78a75b09c932bbad5dae95d49
igordmn pushed a commit that referenced this pull request Jan 30, 2024
API is the same as for Android
WindowInsets.Companion.concreteInsetsName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants