Contextual Toolbar Menu Item
open class ContextualToolbarMenuItem : AppCompatImageButton, View.OnLongClickListener, View.OnLayoutChangeListener
Represents a single menu item in the ContextualToolbar.
Types
Properties
Link copied to clipboard
Menu item that will be selected by default (used with items that have a submenu, items that don't will just use their instance here).
Link copied to clipboard
Tint color of the icon for selected state.
Link copied to clipboard
If true, the item can be selected.
Link copied to clipboard
Keeps track whether the toolbar menu item is selected or not.
Link copied to clipboard
Indicates whether this menu item is first from the end and is a text
Link copied to clipboard
Long-pressing menu items with submenus opens other items in the toolbar for display.
Link copied to clipboard
Currently used only in the AnnotationCreationToolbar.
Functions
Link copied to clipboard
open fun adaptSubmenuIndicatorToParentPosition(@Nullable position: ToolbarCoordinatorLayout.LayoutParams.Position)
Used to allow parent to notify child items of it's new position so the submenu indicator arrow can be placed correctly.
Link copied to clipboard
open fun createGroupItem(@IdRes id: Int, @NonNull position: ContextualToolbarMenuItem.Position, isSelectable: Boolean, @NonNull subMenuItems: List<ContextualToolbarMenuItem>, @NonNull defaultSelectedItem: ContextualToolbarMenuItem): ContextualToolbarMenuItem
Creates a contextual toolbar menu group item with the provided properties.
Link copied to clipboard
open fun createSingleItem(@NonNull context: Context, @IdRes id: Int, @NonNull icon: Drawable, @NonNull title: String, @ColorInt iconColor: Int, @ColorInt iconColorActivated: Int, @NonNull position: ContextualToolbarMenuItem.Position, isSelectable: Boolean): ContextualToolbarMenuItem
Creates a contextual toolbar menu single item with the provided properties.
Link copied to clipboard
open fun createSingleTextItem(@NonNull context: Context, @IdRes id: Int, @NonNull position: ContextualToolbarMenuItem.Position): ContextualToolbarMenuItem
Creates a contextual toolbar menu single ite, with the provided properties.
Link copied to clipboard
Returns true if the menu item has a submenu.
Link copied to clipboard
Link copied to clipboard
Called when a view has been clicked and held.
Link copied to clipboard
Sets if the submenu should be hidden when any item in the submenu is clicked.
Link copied to clipboard
Sets to display menu item as separate item outside of submenu if there's room in the toolbar.
Link copied to clipboard
Sets the enabled state of this view.
Link copied to clipboard
Sets if the submenu should be opened after clicking on the menu item.
Link copied to clipboard
open fun setSubMenuItems(@Nullable subMenuItems: List<ContextualToolbarMenuItem>, @Nullable defaultSelectedMenuItem: ContextualToolbarMenuItem)
Sets the submenu items to the menu item and a default selected item.
Link copied to clipboard
Sets whether the icon should be tinted in iconColor or left as originally provided.
Link copied to clipboard
open fun shouldCloseSubmenuOnItemClick(@NonNull clickedSubmenuItem: ContextualToolbarMenuItem): Boolean
Indicates whether the submenu should be closed after clicking on its items.
Link copied to clipboard
Check whether this item can be expanded from submenu if there's room in the toolbar.
Link copied to clipboard
Indicates whether the submenu should be opened after clicking on the menu item.
Link copied to clipboard