From 0801120c945a07445fcdab4b39bb6560f54993ec Mon Sep 17 00:00:00 2001 From: Arkadii Ivanov Date: Sat, 16 Dec 2023 22:37:07 +0000 Subject: [PATCH] Described LocalStackAnimationProvider in the docs --- docs/extensions/compose.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/extensions/compose.md b/docs/extensions/compose.md index dd549673c..de93855f1 100644 --- a/docs/extensions/compose.md +++ b/docs/extensions/compose.md @@ -276,6 +276,24 @@ fun RootContent(component: RootComponent) { } ``` +### Default stack animations + +By default, the `Children` function (and all other functions with stack animations) does not animate stack changes, the change is performed instantly. The default stack animation is configurable, so that it's possible to avoid specifying the same animation multiple times. + +```kotlin +@Composable +fun App() { + CompositionLocalProvider(LocalStackAnimationProvider provides DefaultStackAnimationProvider) { + // The rest of the code + } +} + +private object DefaultStackAnimationProvider : StackAnimationProvider { + override fun provide(): StackAnimation = + stackAnimation(slide() + scale()) +} +``` + ### Custom animations It is also possible to define custom animations.