| java.lang.Object | |
| ↳ | com.pspdfkit.ui.toolbar.grouping.DefaultMenuItemGroupingRule |
Known Direct Subclasses
|
Known Indirect Subclasses
|
Default grouping rule implementation. Performs collapsing of the menu items if there's not enough room in the toolbar. There will
be an item representing 'More items', whose colors can be styled by pspdf__contextualToolbarStyle.
When clicked, it will open overflown items in the submenu. On the other hand, this class won't
extract items if there's some extra space in the toolbar - that should be the custom implementation if so desired.
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| protected Context | context | ||||||||||
| protected int | iconColor | Tint of the icons in the contextual toolbar. | |||||||||
| protected int | iconColorActivated | Tint of the activated icons in the contextual toolbar. | |||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| DefaultMenuItemGroupingRule(Context context) | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| boolean |
areGeneratedGroupItemsSelectable()
Indicates whether the group items (that are generated to fit items when not enough space) are selectable or not.
| ||||||||||
| List<ContextualToolbarMenuItem> |
groupMenuItems(List<ContextualToolbarMenuItem> flatItems, 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.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.pspdfkit.ui.toolbar.grouping.MenuItemGroupingRule
| |||||||||||
Tint of the icons in the contextual toolbar.
Tint of the activated icons in the contextual toolbar.
Indicates whether the group items (that are generated to fit items when not enough space) are selectable or not.
true if created group menu items should be selectable, false otherwise.
Performs grouping of the provided list of menu items based on the available toolbar capacity, meaning the max number of items it can fit.
| 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). |