Contextual Toolbar
abstract class ContextualToolbar<T : SpecialModeController?> : ViewGroup, View.OnClickListener, View.OnLongClickListener
Base class of all contextual toolbars.
Parameters
<T>
A SpecialModeController type handled by this toolbar.
Inheritors
Types
Link copied to clipboard
interface OnMenuItemClickListener
Listener for menu items clicks.
Link copied to clipboard
interface OnMenuItemLongClickListener
Listener for long clicks on menu items with submenu.
Properties
Link copied to clipboard
Link copied to clipboard
The default toolbar height in DP (in horizontal mode, otherwise it's the toolbar width)
Link copied to clipboard
Alpha value of the drag button (if visible).
Link copied to clipboard
A special button used for dragging the toolbar.
Link copied to clipboard
Indicates whether the toolbar is attached to the edge or it's being moved.
Link copied to clipboard
Indicates whether the toolbar can be dragged to a different position.
Link copied to clipboard
Minimal number of spaces left on the toolbar for menu icons.
Functions
Link copied to clipboard
Binds the special mode controller to this toolbar.
Link copied to clipboard
Finds a menu item with specific ID in a list of currently displayed menu items.
Link copied to clipboard
Returns the button used to close the toolbar.
Link copied to clipboard
Link copied to clipboard
Gets position of the toolbar.
Link copied to clipboard
Returns the submenu's size in pixels, or the amount of space needed for the submenu.
Link copied to clipboard
Returns the toolbar's size in pixels (height in horizontal mode, width in vertical mode) This method has been deprecated and will be removed in a later version.
Link copied to clipboard
Returns true if this contextual toolbar have currently opened submenu.
Link copied to clipboard
Returns
true
if the controller is bound.Link copied to clipboard
Called when onBackPressed() to wire up back press with back and close buttons.
Link copied to clipboard
Called when a view has been clicked and held.
Link copied to clipboard
open fun onMenuItemsGrouped(@NonNull menuItems: List<ContextualToolbarMenuItem>): List<ContextualToolbarMenuItem>
A method called once the flat items provided through setMenuItems have been grouped by the MenuItemGroupingRule that can be set with setMenuItemGroupingRule and with DefaultMenuItemGroupingRule as the default one.
Link copied to clipboard
Link copied to clipboard
Sets the button used to close the toolbar.
Link copied to clipboard
Enables or disables a menu item if that menu item currently exists.
Link copied to clipboard
Sets the rule for grouping menu items.
Link copied to clipboard
Shows or hides a menu item if that menu item currently exists.
Link copied to clipboard
Sets a listener for menu item clicks on the toolbar.
Link copied to clipboard
open fun setOnMenuItemLongClickListener(@Nullable listener: ContextualToolbar.OnMenuItemLongClickListener)
Sets a listener for menu item long clicks.
Link copied to clipboard
Sets position of the toolbar.
Link copied to clipboard
open fun setToolbarCoordinatorController(@Nullable coordinatorController: ToolbarCoordinatorLayoutController)
Sets the toolbar coordinator controller for communication with .
Link copied to clipboard
Sets whether to use back button for closing the toolbar when the toolbar is placed horizontally.
Link copied to clipboard
Unbinds the bound controller (if any).