Skip to content

//workflow/com.squareup.workflow1.ui.container/BackStackScreen

BackStackScreen

[jvm] @WorkflowUiExperimentalApi()

class BackStackScreen<StackedT : Screen>(bottom: StackedT, rest: List<StackedT>) : Screen

Represents an active screen (top), and a set of previously visited screens to which we may return (backStack). By rendering the entire history we allow the UI to do things like maintain cached view state, implement drag-back gestures without waiting for the workflow, etc.

Effectively a list that can never be empty.

UI kits are expected to provide handling for this class by default.

Parameters

jvm

bottom

the bottom-most entry in the stack

rest

the rest of the stack, empty by default

Constructors

BackStackScreen [jvm] fun <StackedT : Screen> BackStackScreen(bottom: StackedT, vararg rest: StackedT)Creates a screen with elements listed from the bottom to the top.
BackStackScreen [jvm] fun <StackedT : Screen> BackStackScreen(bottom: StackedT, rest: List<StackedT>)the bottom-most entry in the stack

Functions

Name Summary
equals [jvm]
Content
open operator override fun equals(other: Any?): Boolean


get [jvm]
Content
operator fun get(index: Int): StackedT


hashCode [jvm]
Content
open override fun hashCode(): Int


map [jvm]
Content
fun <R : Screen> map(transform: (StackedT) -> R): BackStackScreen<R>


mapIndexed [jvm]
Content
fun <R : Screen> mapIndexed(transform: (index: Int, StackedT) -> R): BackStackScreen<R>


plus [jvm]
Content
operator fun plus(other: BackStackScreen<StackedT>?): BackStackScreen<StackedT>


toString [jvm]
Content
open override fun toString(): String


Properties

Name Summary
backStack [jvm] val backStack: List<StackedT>Screens to which we may return.
frames [jvm] val frames: List<StackedT>
top [jvm] val top: StackedTThe active screen.