group Menu Items
open fun groupMenuItems(@NonNull flatItems: List<ContextualToolbarMenuItem>, @IntRange(from = ContextualToolbar.MIN_TOOLBAR_CAPACITY ) capacity: Int): List<ContextualToolbarMenuItem>
Performs grouping of the provided list of menu items based on the available toolbar capacity, meaning the max number of items it can fit.
Return
A re-ordered (could be left the same) list of menu items capacity that will ultimately be set on the toolbar.
Parameters
flat Items
Menu items originally set to the toolbar (note: there should be no submenus here, just flat items).
capacity
Maximum number of items the toolbar can fit (without optional drag and close buttons).