commonMain.com.arkivanov.decompose.extensions.compose.stack.animation.EmptyStackAnimation.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of extensions-compose-jvm Show documentation
Show all versions of extensions-compose-jvm Show documentation
Kotlin Multiplatform lifecycle-aware business logic components
The newest version!
package com.arkivanov.decompose.extensions.compose.stack.animation
import androidx.compose.foundation.layout.Box
import androidx.compose.runtime.Composable
import androidx.compose.runtime.compositionLocalOf
import androidx.compose.ui.Modifier
import com.arkivanov.decompose.Child
import com.arkivanov.decompose.router.stack.ChildStack
internal fun emptyStackAnimation(): StackAnimation =
EmptyStackAnimation()
/*
* Can't be anonymous. See:
* https://github.com/JetBrains/compose-jb/issues/2688
* https://github.com/JetBrains/compose-jb/issues/2612
*/
private class EmptyStackAnimation : StackAnimation {
@Composable
override fun invoke(
stack: ChildStack,
modifier: Modifier,
content: @Composable (child: Child.Created) -> Unit,
) {
Box(modifier = modifier) {
content(stack.active)
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy