BackStack

A caller-supplied stack of Records for presentation with a Navigator. Iteration order is top-first (first element is the top of the stack).

Inheritors

Types

Link copied to clipboard
interface Record

Properties

Link copied to clipboard

true if the BackStack contains exactly one record.

Link copied to clipboard

true if the BackStack contains no records. BackStack.firstOrNull will return null.

Link copied to clipboard
abstract val size: Int

The number of records contained in this BackStack that will be seen by an iterator.

Link copied to clipboard
abstract val topRecord: R?

The top-most record in the BackStack, or null if the BackStack is empty.

Functions

Link copied to clipboard
abstract fun containsRecord(record: R, includeSaved: Boolean): Boolean

Whether the back stack contains the given record.

Link copied to clipboard
abstract operator fun iterator(): Iterator<R>
Link copied to clipboard
abstract fun pop(result: PopResult? = null): R?

Attempt to pop the top item off of the back stack, returning the popped Record if popping was successful or null if no entry was popped.

Link copied to clipboard
open fun popUntil(predicate: (R) -> Boolean): ImmutableList<R>

Pop records off the top of the backstack until one is found that matches the given predicate.

Link copied to clipboard
abstract fun push(record: R, resultKey: String? = null): Boolean

Push a new Record onto the back stack. The new record will become the top of the stack.

abstract fun push(screen: Screen, resultKey: String? = null): Boolean

Push a new Screen onto the back stack. This will be enveloped in a Record and the new record will become the top of the stack.

Link copied to clipboard
abstract fun restoreState(screen: Screen): Boolean

Restores the saved state with the given screen, adding it on top of the existing entry list. If you wish to replace the current entry list, you should pop all of the existing entries off before calling this function.

Link copied to clipboard
abstract fun saveState()

Saves the current back stack entry list in an internal state store. It can be later restored by the root screen to restoreState.