File tree Expand file tree Collapse file tree
samples/app/src/main/kotlin/com/bumble/appyx/app/node/backstack Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import androidx.compose.ui.Alignment
1616import androidx.compose.ui.Modifier
1717import androidx.compose.ui.unit.dp
1818import androidx.lifecycle.coroutineScope
19+ import android.os.Parcelable
1920import com.bumble.appyx.app.node.backstack.InsideTheBackStack.NavTarget
2021import com.bumble.appyx.app.node.backstack.app.ChildNode
2122import com.bumble.appyx.app.node.backstack.app.composable.CustomButton
@@ -30,6 +31,7 @@ import com.bumble.appyx.core.node.Node
3031import com.bumble.appyx.core.node.ParentNode
3132import kotlinx.coroutines.delay
3233import kotlinx.coroutines.isActive
34+ import kotlinx.parcelize.Parcelize
3335
3436class InsideTheBackStack (
3537 buildContext : BuildContext ,
@@ -61,7 +63,8 @@ class InsideTheBackStack(
6163 }
6264 }
6365
64- sealed class NavTarget {
66+ sealed class NavTarget : Parcelable {
67+ @Parcelize
6568 data class Child (val index : Int ) : NavTarget() {
6669 override fun toString (): String = index.toString()
6770 }
Original file line number Diff line number Diff line change 11package com.bumble.appyx.app.node.backstack.app.indexedbackstack
22
3+ import android.os.Parcelable
34import com.bumble.appyx.core.navigation.BaseNavModel
45import com.bumble.appyx.core.navigation.NavElements
56import com.bumble.appyx.core.navigation.NavKey
67import com.bumble.appyx.core.navigation.Operation
78import com.bumble.appyx.core.state.SavedStateMap
9+ import kotlinx.parcelize.Parcelize
810
911class IndexedBackStack <NavTarget : Any >(
1012 savedState : SavedStateMap ? ,
@@ -15,14 +17,20 @@ class IndexedBackStack<NavTarget : Any>(
1517 savedStateMap = savedState
1618) {
1719
18- sealed interface State {
20+ sealed interface State : Parcelable {
21+ @Parcelize
1922 object Created : State
23+
24+ @Parcelize
2025 object Active : State
21- class Stashed (
26+
27+ @Parcelize
28+ data class Stashed (
2229 val index : Int ,
2330 val size : Int
2431 ) : State
2532
33+ @Parcelize
2634 object Destroyed : State
2735 }
2836
You can’t perform that action at this time.
0 commit comments