Package com.pspdfkit.ui.toolbar.grouping
Interface MenuItemGroupingRule
-
- All Implemented Interfaces:
public interface MenuItemGroupingRule
Interface for classes that will define rules for grouping ContextualToolbarMenuItems in the ContextualToolbar.
-
-
Method Summary
Modifier and Type Method Description abstract List<ContextualToolbarMenuItem>
groupMenuItems(@NonNull() List<ContextualToolbarMenuItem> flatItems, @IntRange(from = ContextualToolbar.MIN_TOOLBAR_CAPACITY) int capacity)
Performs grouping of the provided list of menu items based on the available toolbar capacity, meaning the max number of items it can fit. abstract boolean
areGeneratedGroupItemsSelectable()
Indicates whether the group items (that are generated to fit items when not enough space) are selectable or not. -
-
Method Detail
-
groupMenuItems
@NonNull() abstract List<ContextualToolbarMenuItem> groupMenuItems(@NonNull() List<ContextualToolbarMenuItem> flatItems, @IntRange(from = ContextualToolbar.MIN_TOOLBAR_CAPACITY) int capacity)
Performs grouping of the provided list of menu items based on the available toolbar capacity, meaning the max number of items it can fit.
- Parameters:
flatItems
- 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).- Returns:
A re-ordered (could be left the same) list of menu items capacity that will ultimately be set on the toolbar.
-
areGeneratedGroupItemsSelectable
abstract boolean areGeneratedGroupItemsSelectable()
Indicates whether the group items (that are generated to fit items when not enough space) are selectable or not.
- Returns:
true
if created group menu items should be selectable,false
otherwise.
-
-
-
-