BaseOnItemViewSelectedListener


interface BaseOnItemViewSelectedListener<T>

Known direct subclasses
OnItemViewSelectedListener

Interface for receiving notification when a row or item becomes selected.


Interface for receiving notification when a row or item becomes selected. The concept of current selection is different than focus. A row or item can be selected without having focus; for example, when a row header view gains focus then the corresponding row view becomes selected.

Summary

Public functions

Unit
onItemSelected(
    itemViewHolder: Presenter.ViewHolder!,
    item: Any!,
    rowViewHolder: RowPresenter.ViewHolder!,
    row: T!
)

Called when a row or a new item becomes selected.

Public functions

onItemSelected

Added in 1.1.0
fun onItemSelected(
    itemViewHolder: Presenter.ViewHolder!,
    item: Any!,
    rowViewHolder: RowPresenter.ViewHolder!,
    row: T!
): Unit

Called when a row or a new item becomes selected.

For a non ListRow case, parameter item may be null. Event is fired when selection changes between rows, regardless if row view has focus or not.

For a ListRow case, parameter item is null if the list row is empty.

In the case of a grid, the row parameter is always null.

  • Row has focus: event is fired when focus changes between children of the row.
  • No row has focus: the event is fired with the currently selected row and last focused item in the row.
Parameters
itemViewHolder: Presenter.ViewHolder!

The view holder of the item that is currently selected.

item: Any!

The item that is currently selected.

rowViewHolder: RowPresenter.ViewHolder!

The view holder of the row that is currently selected.

row: T!

The row that is currently selected.