Add slide transitions

This commit is contained in:
vfsfitvnm
2022-06-07 19:29:03 +02:00
parent c5f3e5b766
commit 7f20dce446
2 changed files with 13 additions and 11 deletions

View File

@@ -4,6 +4,16 @@ import androidx.compose.animation.*
import androidx.compose.animation.core.tween
@ExperimentalAnimationApi
val AnimatedContentScope<RouteHandlerScope>.leftSlide: ContentTransform
get() = slideIntoContainer(AnimatedContentScope.SlideDirection.Left) with
slideOutOfContainer(AnimatedContentScope.SlideDirection.Left)
@ExperimentalAnimationApi
val AnimatedContentScope<RouteHandlerScope>.rightSlide: ContentTransform
get() = slideIntoContainer(AnimatedContentScope.SlideDirection.Right) with
slideOutOfContainer(AnimatedContentScope.SlideDirection.Right)
@ExperimentalAnimationApi
val AnimatedContentScope<RouteHandlerScope>.fastFade: ContentTransform
get() = fadeIn(tween(200)) with fadeOut(tween(200))