ShellLayoutPolicy

data class ShellLayoutPolicy(val railFrom: Dp = 600.dp, val expandedRailFrom: Dp = 840.dp, val permanentDrawerFrom: Dp = 1200.dp, val listDetailFrom: Dp = 600.dp, val contentMaxWidth: Dp = Dp.Unspecified, val largeTopBarFrom: Dp = 480.dp, val hideSingleTabBottomBar: Boolean = false)(source)

The window widths at which ShellLayoutMode.Auto moves to the next mode, and at which list and detail pages start sharing the window, with an opt-in to hide a single tab's bottom bar. The default widths are Material's window size class breakpoints: medium at 600dp, expanded at 840dp and large at 1200dp.

Constructors

Link copied to clipboard
constructor(railFrom: Dp = 600.dp, expandedRailFrom: Dp = 840.dp, permanentDrawerFrom: Dp = 1200.dp, listDetailFrom: Dp = 600.dp, contentMaxWidth: Dp = Dp.Unspecified, largeTopBarFrom: Dp = 480.dp, hideSingleTabBottomBar: Boolean = false)

Properties

Link copied to clipboard

The widest a destination's content grows before the shell centres it with margins on both sides. Dp.Unspecified lets content fill any window. Destinations opt out with ContentWidth.Full.

Link copied to clipboard
Link copied to clipboard

Omits the bottom navigation bar when the graph has exactly one tab. The phone's menu and modal drawer, and every wide navigation layout, remain available. A second tab restores the bar automatically. Defaults to false to preserve existing hosts.

Link copied to clipboard

Below this window height a large app bar would take too much of the screen; a small one is drawn.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Whether resolve gives ShellLayoutMode.BottomBar for some window: every threshold is above zero.

Link copied to clipboard

Whether resolve gives a rail or the permanent drawer for some window: one threshold is a finite width. Dp.Infinity turns a mode off.

Functions

Link copied to clipboard
fun resolve(requested: ShellLayoutMode, width: Dp): ShellLayoutMode