createSingleItem

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. This is an image item

Parameters

context

Context of the component creating the button.

id

Menu item id.

icon

Icon for the menu item.

title

Menu item title.

iconColor

Menu item color for default selected state (not selected).

iconColorActivated

Menu item color for selected state (if possible).

position

Position of the menu item in the toolbar.

isSelectable

true if menu item can be selected, false if it can only be clicked.