Skip to content

Commit 9d74dcf

Browse files
LissFclaude
andcommitted
Add missing Parcelable to InsideTheBackStack.NavTarget and IndexedBackStack.State
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 910f6c9 commit 9d74dcf

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

samples/app/src/main/kotlin/com/bumble/appyx/app/node/backstack/InsideTheBackStack.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import androidx.compose.ui.Alignment
1616
import androidx.compose.ui.Modifier
1717
import androidx.compose.ui.unit.dp
1818
import androidx.lifecycle.coroutineScope
19+
import android.os.Parcelable
1920
import com.bumble.appyx.app.node.backstack.InsideTheBackStack.NavTarget
2021
import com.bumble.appyx.app.node.backstack.app.ChildNode
2122
import com.bumble.appyx.app.node.backstack.app.composable.CustomButton
@@ -30,6 +31,7 @@ import com.bumble.appyx.core.node.Node
3031
import com.bumble.appyx.core.node.ParentNode
3132
import kotlinx.coroutines.delay
3233
import kotlinx.coroutines.isActive
34+
import kotlinx.parcelize.Parcelize
3335

3436
class 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
}

samples/app/src/main/kotlin/com/bumble/appyx/app/node/backstack/app/indexedbackstack/IndexedBackStack.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package com.bumble.appyx.app.node.backstack.app.indexedbackstack
22

3+
import android.os.Parcelable
34
import com.bumble.appyx.core.navigation.BaseNavModel
45
import com.bumble.appyx.core.navigation.NavElements
56
import com.bumble.appyx.core.navigation.NavKey
67
import com.bumble.appyx.core.navigation.Operation
78
import com.bumble.appyx.core.state.SavedStateMap
9+
import kotlinx.parcelize.Parcelize
810

911
class 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

0 commit comments

Comments
 (0)