itemClicks

Create a Flow of item clicks on the AdapterView instance where the value emitted is the position of the item clicked.

Note: Created flow keeps a strong reference to the AdapterView instance until the coroutine that launched the flow collector is cancelled.

Example of usage:

adapterView.itemClickEvents()
.onEach { position ->
// handle adapter view item clicked
}
.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)