Contextual Toolbar State
State slice for the currently displayed contextual toolbar. null on the coordinator's contextualToolbar flow means no contextual toolbar is shown.
Items reuse the main-toolbar item model (ToolbarItem.Button / ToolbarItem.Toggle / ToolbarItem.Submenu); the item list is flat and pre-grouped by the producer, same contract as ToolbarItems.
position and isDraggable carry the legacy ContextualToolbar docking behavior: the bar can dock ToolbarPosition.Top, ToolbarPosition.Start, or ToolbarPosition.End, and the user can drag it between those positions when isDraggable is true.
Constructors
Properties
Docks the user may drag the bar to — the View LayoutParams.allowedPositions. Drag releases only ever resolve to one of these; position itself is not required to be in the set (the View logs and corrects that case, producers here are trusted). Defaults to all three docks.
Item ids ranked most-recently-used first. When a synthesized group has no selected child, it represents itself with its highest-ranked child instead of the first one — the View annotation toolbar's last-used-tool-as-group-default behavior. Empty (the default) keeps first-child representation.
Whether the user may drag the bar between docking positions.
Flat, pre-grouped item list rendered by the generic contextual toolbar.
Which mode bar this state belongs to.
Which window edge the bar is docked against.
The View ContextualToolbar.setUseBackButtonForCloseWhenHorizontal flag: when true (the View default), a ToolbarPosition.Top-docked bar renders its close button as a back arrow at the leading edge; side-docked (and always when false) the close button is a circled X at the trailing end.