-
Notifications
You must be signed in to change notification settings - Fork 76
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
Insets on iOS #577
Conversation
...ndation-layout/src/uikitMain/kotlin/androidx/compose/foundation/layout/WindowInsets.uikit.kt
Outdated
Show resolved
Hide resolved
...ndation-layout/src/uikitMain/kotlin/androidx/compose/foundation/layout/WindowInsets.uikit.kt
Outdated
Show resolved
Hide resolved
...ndation-layout/src/uikitMain/kotlin/androidx/compose/foundation/layout/WindowInsets.uikit.kt
Outdated
Show resolved
Hide resolved
...ndation-layout/src/uikitMain/kotlin/androidx/compose/foundation/layout/WindowInsets.uikit.kt
Outdated
Show resolved
Hide resolved
...ndation-layout/src/uikitMain/kotlin/androidx/compose/foundation/layout/WindowInsets.uikit.kt
Outdated
Show resolved
Hide resolved
*/ | ||
val WindowInsets.Companion.systemGestures: WindowInsets | ||
@Composable | ||
get() = layoutMargins // the same as iosSafeArea.add(WindowInsets(left = 16.dp, right = 16.dp)) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
compose/mpp/demo/src/uikitMain/kotlin/androidx/compose/mpp/demo/main.uikit.kt
Outdated
Show resolved
Hide resolved
import androidx.compose.ui.main.defaultUIKitMain | ||
import androidx.compose.ui.window.ComposeUIViewController | ||
|
||
fun main() { | ||
defaultUIKitMain("ComposeDemo", ComposeUIViewController { | ||
val app = remember { App() } | ||
app.Content() | ||
IosDemo() |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
compose/ui/ui/src/uikitMain/kotlin/androidx/compose/ui/uikit/Insets.uikit.kt
Outdated
Show resolved
Hide resolved
} ?: error("Can't find orientation rawValue $orientation in enum InterfaceOrientation") | ||
} | ||
|
||
fun getStatusBarOrientation(): InterfaceOrientation = |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
compose/ui/ui/src/uikitMain/kotlin/androidx/compose/ui/uikit/KeyboardOverlapHeight.uikit.kt
Outdated
Show resolved
Hide resolved
…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>
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
API is the same as for Android WindowInsets.Companion.concreteInsetsName
Added WindowInsets to iOS