-
Notifications
You must be signed in to change notification settings - Fork 88
Wrap a screen content to a Box for the iOS back animation blackout #2146
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
Conversation
navigation/navigation-compose/src/uikitMain/kotlin/androidx/navigation/compose/NavHost.uikit.kt
Outdated
Show resolved
Hide resolved
navigation/navigation-compose/src/commonMain/kotlin/androidx/navigation/compose/NavHost.kt
Show resolved
Hide resolved
navigation/navigation-compose/src/uikitMain/kotlin/androidx/navigation/compose/NavHost.uikit.kt
Show resolved
Hide resolved
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.
LGTM in general, just a few nitpicks
navigation/navigation-compose/src/uikitMain/kotlin/androidx/navigation/compose/NavHost.uikit.kt
Outdated
Show resolved
Hide resolved
@@ -719,28 +721,33 @@ internal fun NavHost( | |||
// while in the scope of the composable, we provide the navBackStackEntry as the | |||
// ViewModelStoreOwner and LifecycleOwner | |||
currentEntry?.LocalOwnersProvider(saveableStateHolder) { | |||
(currentEntry.destination as ComposeNavigator.Destination).content( |
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 probably makes sense to extract our extra drawing into a separate function to simplify the diff with AOSP (+ it's already a huge function)
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.
there is a lot of the local context to pass to the new function. readability will be worse
It fixes a crash when NavHost is located inside a scrollable container and there is no available max size.
It fixes a crash when NavHost is located inside a scrollable container and there is no available max size.
The reason is an additional iOS blackout layer.
Simple reproducer:
Inside the
verticalScroll
it is not possible to measure constrains:So, I wrapped the screen content in an additional Box and use
matchParentSize()
modifier now.Fixes https://youtrack.jetbrains.com/issue/CMP-8233
Release Notes
Fixes - Navigation
NavHost
is located in a scrollable container