itemClicks
Create a Flow of item clicked events on the ActionMenuView instance where the value emitted is the clicked menu item.
Note: Created flow keeps a strong reference to the ActionMenuView instance until the coroutine that launched the flow collector is cancelled.
Example of usage:
actionMenuView.itemClicks()
.onEach { menuItem ->
// handle menuItem
}
.launchIn(uiScope)
Create a Flow of item clicked events on the PopupMenu instance where the value emitted is the clicked menu item.
Note: Created flow keeps a strong reference to the PopupMenu instance until the coroutine that launched the flow collector is cancelled.
Example of usage:
popupMenu.itemClicks()
.onEach { menuItem ->
// handle menuItem
}
.launchIn(uiScope)
Create a Flow of item clicked events on the Toolbar instance where the value emitted is the clicked menu item.
Note: Created flow keeps a strong reference to the Toolbar instance until the coroutine that launched the flow collector is cancelled.
Example of usage:
toolbar.itemClicks()
.onEach { menuItem ->
// handle menuItem
}
.launchIn(uiScope)