diff --git a/samples/app/src/main/kotlin/com/bumble/appyx/app/node/backstack/InsideTheBackStack.kt b/samples/app/src/main/kotlin/com/bumble/appyx/app/node/backstack/InsideTheBackStack.kt index 4dd7c01fe..28a89ad15 100644 --- a/samples/app/src/main/kotlin/com/bumble/appyx/app/node/backstack/InsideTheBackStack.kt +++ b/samples/app/src/main/kotlin/com/bumble/appyx/app/node/backstack/InsideTheBackStack.kt @@ -1,5 +1,6 @@ package com.bumble.appyx.app.node.backstack +import android.os.Parcelable import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box @@ -30,6 +31,7 @@ import com.bumble.appyx.core.node.Node import com.bumble.appyx.core.node.ParentNode import kotlinx.coroutines.delay import kotlinx.coroutines.isActive +import kotlinx.parcelize.Parcelize class InsideTheBackStack( buildContext: BuildContext, @@ -61,7 +63,8 @@ class InsideTheBackStack( } } - sealed class NavTarget { + sealed class NavTarget : Parcelable { + @Parcelize data class Child(val index: Int) : NavTarget() { override fun toString(): String = index.toString() } diff --git a/samples/app/src/main/kotlin/com/bumble/appyx/app/node/backstack/app/indexedbackstack/IndexedBackStack.kt b/samples/app/src/main/kotlin/com/bumble/appyx/app/node/backstack/app/indexedbackstack/IndexedBackStack.kt index aeb197321..84093f466 100644 --- a/samples/app/src/main/kotlin/com/bumble/appyx/app/node/backstack/app/indexedbackstack/IndexedBackStack.kt +++ b/samples/app/src/main/kotlin/com/bumble/appyx/app/node/backstack/app/indexedbackstack/IndexedBackStack.kt @@ -1,10 +1,12 @@ package com.bumble.appyx.app.node.backstack.app.indexedbackstack +import android.os.Parcelable import com.bumble.appyx.core.navigation.BaseNavModel import com.bumble.appyx.core.navigation.NavElements import com.bumble.appyx.core.navigation.NavKey import com.bumble.appyx.core.navigation.Operation import com.bumble.appyx.core.state.SavedStateMap +import kotlinx.parcelize.Parcelize class IndexedBackStack( savedState: SavedStateMap?, @@ -15,14 +17,20 @@ class IndexedBackStack( savedStateMap = savedState ) { - sealed interface State { + sealed interface State : Parcelable { + @Parcelize object Created : State + + @Parcelize object Active : State - class Stashed( + + @Parcelize + data class Stashed( val index: Int, val size: Int ) : State + @Parcelize object Destroyed : State }