Most visited

Recently visited

BaseOnItemViewSelectedListener

public interface BaseOnItemViewSelectedListener

android.support.v17.leanback.widget.BaseOnItemViewSelectedListener<T>
Known Indirect Subclasses


用于在行或项目被选中时接收通知的界面。 当前选择的概念与焦点不同。 可以选择一行或一个项目而不需要重点; 例如,当行标题视图获得焦点时,则相应的行视图将被选中。

Summary

Public methods

abstract void onItemSelected(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, T row)

当选中一行或一个新项目时调用。

Public methods

onItemSelected

void onItemSelected (Presenter.ViewHolder itemViewHolder, 
                Object item, 
                RowPresenter.ViewHolder rowViewHolder, 
                T row)

当选中一行或一个新项目时调用。

对于非ListRow情况,参数项可能为空。 无论行视图是否具有焦点,行之间的选择更改时都会触发事件。

对于 ListRow大小写,如果列表行为空,则参数项目为空。

在网格的情况下,行参数始终为空。

  • 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 Object: 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.

    Hooray!