ToolbarInsets

sealed interface ToolbarInsets

Host-neutral description of the window insets the main toolbar reserves for its own content.

This lives in the Android-free compose/toolbar/state package (the ToolbarSharedPackageLeak lint rule, MOD-4), so it deliberately does not reference androidx.compose.foundation.layout.WindowInsets. The composable layer (com.pspdfkit.compose.toolbar.composables.NutrientMainToolbar) maps it to a real WindowInsets at render time.

Drive it through com.pspdfkit.compose.toolbar.adapter.ToolbarCoordinator.setMainToolbarInsets so it works for every host — including the SDK-mounted toolbar in PdfActivity / PdfUiFragment, where there is no NutrientMainToolbar call site to pass a parameter to.

Inheritors

Types

Link copied to clipboard
object Companion

Factory helpers for constructing ToolbarInsets values from non-Compose (Java/View) code.

Link copied to clipboard
data class Custom(val top: Dp = 0.dp, val bottom: Dp = 0.dp, val start: Dp = 0.dp, val end: Dp = 0.dp, val includesSideSystemBars: Boolean = false) : ToolbarInsets

Reserve a fixed inset on each edge. start / end are logical: they resolve to the right / left edge in an RTL layout.

Link copied to clipboard
data object None : ToolbarInsets

Reserve no insets. Use when the toolbar is placed away from the top edge — nested under other content, or below a parent that already provides the top spacing.

Link copied to clipboard

Inset the toolbar content by the system status-bar height. The default — correct when the toolbar is mounted edge-to-edge at the top of the window (the SDK's own mounting).

Properties

Link copied to clipboard

Whether the toolbar additionally reserves the side system bars — the navigation bar and display cutout when one is docked to the left or right edge, which is to say in landscape.