FloatingToolbarState

class FloatingToolbarState(initialEdge: FloatingToolbarEdge = FloatingToolbarEdge.Bottom, val allowedEdges: Set<FloatingToolbarEdge> = FloatingToolbarEdge.entries.toSet())

Observable UI state of a NutrientFloatingToolbar: which edge it is docked against and whether a drag is in flight. Create it with rememberFloatingToolbarState so the docked edge survives configuration changes and process death.

Note this is deliberately not part of ToolbarCoordinator — the coordinator owns the host-agnostic toolbar model (items, visibility, actions); where a floating rendering of it sits on screen is a per-composable presentation concern, like scroll position.

Constructors

Link copied to clipboard
constructor(initialEdge: FloatingToolbarEdge = FloatingToolbarEdge.Bottom, allowedEdges: Set<FloatingToolbarEdge> = FloatingToolbarEdge.entries.toSet())

Properties

Link copied to clipboard

The R.id of the item shown while collapsed — the last item the user tapped from the expanded menu. null (or an id no longer in the item list) falls back to the first selected item, then the first item.

Link copied to clipboard

The edges the toolbar may dock against. Dragging only ever snaps to one of these.

Link copied to clipboard

The edge the toolbar is currently docked against.

Link copied to clipboard

true while the user is actively dragging the toolbar.

Link copied to clipboard

Whether the toolbar shows its full item row. Only consulted when the rendering composable is collapsible (see NutrientFloatingToolbar's collapsible parameter): collapsed (false), the pill shrinks to a single button showing the active item, and tapping it expands the full menu again.

Link copied to clipboard

Whether the toolbar currently lays its items out vertically (edge is Start/End).

Link copied to clipboard

While a drag is in flight, the edge of the dock zone currently under the pill — the pill previews this edge's orientation live, flipping horizontal↔vertical as the drag crosses zone boundaries. null while not dragging.

Functions

Link copied to clipboard
fun collapse()

Collapses the pill down to just the active item (no-op visual unless collapsible).

Link copied to clipboard

Docks the toolbar against edge programmatically. Must be one of allowedEdges.

Link copied to clipboard
fun expand()

Expands the collapsed pill back to the full item row.