ListDetailScene

data class ListDetailScene<T : Any>(val key: Any, val listEntry: NavEntry<T>, val detailEntry: NavEntry<T>?, val previousEntries: List<NavEntry<T>>, onBack: () -> Unit, framed: Boolean = true) : Scene<T> (source)

A list page with the detail opened from it beside it, or with a placeholder until one is.

The scene draws one app bar across both panes, the list's title over the list and the detail's over the detail, instead of letting each page draw its own. Between the panes sits a separator the person can drag to resize them. Dragging it most of the way to the end closes the detail, and the back gesture on a detail does the same thing under the finger: the separator follows the gesture toward the end, the detail sliding out with it, and settles back once the detail closes.

The scene is keyed by the list, so opening, switching or closing details never moves the page as a whole. Entering and leaving the list still uses the page transitions, like any other page.

The scene, its list and detail metadata and its width-gated strategy are adapted from the list-detail scene recipe in android/nav3-recipes, Apache License 2.0. The shared app bar, the separator and slide to pop are the shell's; the separator follows the "slide to pop" animation in 3 unique predictive back animations you can create with the Navigation Events library (tunjid.com).

Constructors

Link copied to clipboard
constructor(key: Any, listEntry: NavEntry<T>, detailEntry: NavEntry<T>?, previousEntries: List<NavEntry<T>>, onBack: () -> Unit, framed: Boolean = true)

Types

Link copied to clipboard

Properties

Link copied to clipboard
open override val content: @Composable () -> Unit
Link copied to clipboard
Link copied to clipboard
open override val entries: List<NavEntry<T>>
Link copied to clipboard
open override val key: Any
Link copied to clipboard
Link copied to clipboard
open val metadata: Map<String, Any>
Link copied to clipboard
open override val previousEntries: List<NavEntry<T>>
Link copied to clipboard