-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make scene provide an AnimatedContentScope to the composable content
This scope is the one that drives the navigation transition, which allows callers to use it to drive other animations inside the screen itself as it animates into or out of the NavHost. Notably, this allows callers to use the shared element transitions.
- Loading branch information
1 parent
0db393c
commit 2c4d92d
Showing
5 changed files
with
76 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
precompose/src/commonMain/kotlin/moe/tlaster/precompose/navigation/route/ComposeRoute.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 11 additions & 2 deletions
13
precompose/src/commonMain/kotlin/moe/tlaster/precompose/navigation/route/FloatingRoute.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
package moe.tlaster.precompose.navigation.route | ||
|
||
import androidx.compose.animation.AnimatedContentScope | ||
import androidx.compose.runtime.Composable | ||
import moe.tlaster.precompose.navigation.BackStackEntry | ||
|
||
internal class FloatingRoute( | ||
override val content: @Composable (BackStackEntry) -> Unit, | ||
override val content: @Composable AnimatedContentScope.(BackStackEntry) -> Unit, | ||
override val route: String, | ||
) : ComposeRoute, ComposeFloatingRoute | ||
) : ComposeRoute, ComposeFloatingRoute { | ||
internal constructor( | ||
route: String, | ||
content: @Composable (BackStackEntry) -> Unit | ||
) : this( | ||
{ entry -> content(entry) }, | ||
route, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters