NutrientContextualToolbarDefaults

Defaults for NutrientContextualToolbar, one per parameter, so a host overrides one value and inherits the rest — the TopAppBarDefaults shape — plus the sizing constants the bar shares with NutrientToolbarScaffold (the Compose home of the View ToolbarCoordinatorLayout styleable defaults).

The bar has two looks, chosen by where it is docked: a flat strip spanning the window when top-docked (Shape, no border) and a detached, rounded, bordered bar when docked to a side (SideDockedShape, sideDockedBorder) — the View roundCornersIfVertical() treatment. A host that wants one look everywhere passes the same value for both.

Properties

Link copied to clipboard

Corner radius of the side drop-zone placeholders (the View MENU_BAR_CORNER_RADIUS_DP).

Link copied to clipboard
const val DropZoneFadeMillis: Int = 300

Duration of the drop-zone fade (the View TOOLBARS_FADE_DURATION_MS).

Link copied to clipboard

The show animation: a fade, the View ToolbarCoordinatorLayout's show/hide animation class.

Link copied to clipboard

The hide animation: a fade, matching enterTransition.

Link copied to clipboard

Margin between a side-docked vertical bar and its window edge (pspdf__vertical_toolbar_horizontal_margin).

Link copied to clipboard

How the items indicate press, hover and selection — ToolbarItemIndication.Default.

Link copied to clipboard

No insets at all — the default, because the bar's insets are its container's business: NutrientToolbarScaffold places the bar inside the window insets and paints the status-bar strip itself, and a host positioning the bar in its own Box pads that. Pass real insets only for a bar composed edge to edge with nothing around it.

Link copied to clipboard

The bar's shadow elevation, from the pspdf__toolbar_elevation dimension.

Link copied to clipboard

The top-docked bar's shape: square, because it spans the window edge to edge.

Link copied to clipboard

The side-docked bar's border width — the View ContextualToolbarMenuBar.BORDER_STROKE_WIDTH_DP.

Link copied to clipboard

The side-docked bar's shape — detached from the window edge with 16dp corners, the View ContextualToolbarMenuBar.CORNER_RADIUS_DP.

Link copied to clipboard

The contextual bar's cross-axis size (the View pspdf__contextualToolbarHeight, 58dp).

Link copied to clipboard

Margin above and below a side-docked vertical bar (pspdf__vertical_toolbar_vertical_margin).

Functions

Link copied to clipboard

The bar's colors: the ambient theme's main-toolbar scheme with the XML pspdf__contextualToolbarStyle attributes — background, icon, activated icon and submenu background — laid over it, which is what the View bars painted. The bar reuses MainToolbarColors because its buttons and submenu sheet are the main toolbar's; popup is the submenu sheet's background. Override one with copy: NutrientContextualToolbarDefaults.colors().copy(backgroundColor = …).

Link copied to clipboard

The themed drop-zone placeholder color — the View pspdf__dragTargetColor styleable of pspdf__ToolbarCoordinatorLayout, resolved with the same default chain.

Link copied to clipboard

The side-docked bar's border: SideDockedBorderWidth in the XML pspdf__contextualToolbarStyle border color.

Link copied to clipboard

The theme's android:statusBarColor — what the View dispatchDraw painted into the strip above a top-docked contextual bar (statusBarPaint). Transparent when the theme doesn't define one (edge-to-edge hosts that manage the strip themselves).

Link copied to clipboard
fun toolbarSize(context: Context): Dp

The themed contextual bar cross-axis size — the View pspdf__contextualToolbarHeight styleable of pspdf__ToolbarCoordinatorLayout, resolved with the same default chain (ToolbarSize when the theme doesn't override it).