From c68609a226e0ac0739f4637647da894099c46cca Mon Sep 17 00:00:00 2001 From: Yegor Zatsepin Date: Tue, 17 Feb 2026 18:00:23 +0200 Subject: [PATCH] Add missing Parcelable to InsideTheBackStack.NavTarget and IndexedBackStack.State Co-Authored-By: Claude Opus 4.6 --- .../appyx/app/node/backstack/InsideTheBackStack.kt | 5 ++++- .../app/indexedbackstack/IndexedBackStack.kt | 12 ++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) 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 }