ShellGraphBuilder

class ShellGraphBuilder(@StringRes appTitle: Int, appIcon: ToolkitIcon? = null, val defaults: NavigationDefaults = NavigationDefaults())(source)

Collects an app's destinations. The host creates it, lets each feature and the app register their destinations, and calls build.

A destination registered without a topBar takes the style defaults gives its kind.

Constructors

Link copied to clipboard
constructor(@StringRes appTitle: Int, appIcon: ToolkitIcon? = null, defaults: NavigationDefaults = NavigationDefaults())

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun banner(content: @Composable () -> Unit)

Optional host content above the navigation bar. Absent unless explicitly registered, and steps aside while the player is showing.

Link copied to clipboard
Link copied to clipboard
inline fun <reified K : NavKey> child(topBar: TopBarStyle? = null, paneRole: PaneRole = PaneRole.None, contentWidth: ContentWidth = ContentWidth.Default, noinline title: @Composable (K) -> String, noinline actions: @Composable RowScope.(K) -> Unit? = null, transition: ScreenTransition? = null, noinline fab: @Composable (K) -> Unit? = null, noinline fabs: @Composable (K) -> List<ToolkitFab>? = null, topBarScrollMode: TopBarScrollMode = TopBarScrollMode.Default, noinline content: @Composable (K) -> Unit)

Adds a destination pushed inside the current tab, keeping the navigation bar.

Link copied to clipboard
fun deepLinks(builder: DeepLinkBuilder.() -> Unit)

Maps the intents the app's activity receives, at launch or while running, to destinations: a launcher shortcut, a notification, a widget or a link. The host opens the destination as if a screen had called navigate(key).

Link copied to clipboard
fun drawer(builder: DrawerBuilder.() -> Unit)

Lists the drawer's entries, top to bottom. Entries given to DrawerBuilder.footer come after all of them, pinned to the bottom edge, whatever order the calls were made in.

Link copied to clipboard
fun overflow(builder: DrawerBuilder.() -> Unit)

Lists the entries of the app bar's overflow menu, shown on the tabs' roots. A DrawerEntry.Spacer draws a divider. supportUs() adds the Support page, the way the Toolkit's app bar offers it.

Link copied to clipboard
inline fun <reified K : NavKey> page(topBar: TopBarStyle? = null, paneRole: PaneRole = PaneRole.None, contentWidth: ContentWidth = ContentWidth.Default, noinline title: @Composable (K) -> String? = null, noinline actions: @Composable RowScope.(K) -> Unit? = null, transition: ScreenTransition? = null, noinline fab: @Composable (K) -> Unit? = null, noinline fabs: @Composable (K) -> List<ToolkitFab>? = null, noinline placeholder: @Composable () -> Unit? = null, topBarScrollMode: TopBarScrollMode = TopBarScrollMode.Default, backButton: Boolean = true, noinline content: @Composable (K) -> Unit)

Adds a destination that covers the shell like an activity would.

Link copied to clipboard
inline fun <reified K : NavKey> pageIfAbsent(paneRole: PaneRole, noinline title: @Composable (K) -> String?, topBar: TopBarStyle? = null, noinline actions: @Composable RowScope.(K) -> Unit? = null, noinline fabs: @Composable (K) -> List<ToolkitFab>? = null, noinline placeholder: @Composable () -> Unit? = null, topBarScrollMode: TopBarScrollMode = TopBarScrollMode.Default, noinline content: @Composable (K) -> Unit)

Adds a page unless the app registered its own for K. Toolkit features register their pages with it, so an app replaces any of them by registering the same key first.

Link copied to clipboard
fun player(player: ShellPlayer)
Link copied to clipboard
fun start(key: NavKey)

Where the app opens, the first tab if this is not called. A tab opens the shell on it; a page is shown on its own, with no shell under it, as a start screen: it enters the shell by navigating to a tab or calling ShellNavigator.enterShell(), and back from it leaves the app. The host can decide at launch instead, for a screen shown only once.

Link copied to clipboard
fun startScreens(vararg keys: NavKey)

Pages a start screen choice offers besides the tabs, to try a start screen without making it the app's start.

Link copied to clipboard
inline fun <reified K : NavKey> tab(key: K, @StringRes label: Int, icon: ToolkitIcon, selectedIcon: ToolkitIcon = icon, topBar: TopBarStyle? = null, contentWidth: ContentWidth = ContentWidth.Default, badge: String? = null, noinline badgeText: @Composable () -> String?? = null, search: TabSearch? = null, @StringRes shortLabel: Int? = null, paneRole: PaneRole = PaneRole.None, noinline actions: @Composable RowScope.(K) -> Unit? = null, noinline fab: @Composable (K) -> Unit? = null, noinline fabs: @Composable (K) -> List<ToolkitFab>? = null, topBarScrollMode: TopBarScrollMode = TopBarScrollMode.Default, noinline content: @Composable (K) -> Unit)

Adds a root of the shell. Tabs appear in the order they are added, and the first is where the app starts and where back ends before the app closes.

Link copied to clipboard

The transition each kind of destination uses when it declares none: children slide, pages move like activities, unless changed here, for every layout or per layout.