PresetMenuItemGroupingRule

Deprecated

The Compose contextual toolbar keeps honoring getGroupPreset through a bridge, so existing subclasses continue to work for one major version. Migrate to com.pspdfkit.compose.toolbar.state.ContextualToolbarGroupingProvider with com.pspdfkit.compose.toolbar.state.ToolbarPresetEntry — the contracts map 1:1. Removed at the next major version.

Menu item grouping rule to be extended by those rules that have predefined (preset) groups.

Inheritors

Properties

Link copied to clipboard
The minimum menu-item capacity a contextual toolbar lays out — presets are only defined for this size and up.

Functions

Link copied to clipboard
abstract fun getGroupPreset(@IntRange(from = 4) capacity: Int, itemsCount: Int): List<MenuItem>
Implementation of this method should return desired preset (structured list of menu items) based on the provided capacity (space left on the toolbar) and the amount of items that needs to be fitted.
Link copied to clipboard
Performs grouping of the provided list of menu items based on the available toolbar capacity, meaning the max number of items it can fit.