ListRowPresenter.ViewHolder


public class ListRowPresenter.ViewHolder extends RowPresenter.ViewHolder


ViewHolder for the ListRowPresenter.

Summary

Public constructors

ViewHolder(
    @NonNull View rootView,
    @NonNull HorizontalGridView gridView,
    @NonNull ListRowPresenter p
)

Public methods

final @NonNull ItemBridgeAdapter

Gets ItemBridgeAdapter that creates the list of items.

final @NonNull HorizontalGridView

Gets HorizontalGridView that shows a list of items.

@Nullable Presenter.ViewHolder
getItemViewHolder(int position)

Gets ViewHolder at a position in adapter.

final @NonNull ListRowPresenter

Gets ListRowPresenter that creates this ViewHolder.

@Nullable Object

Return currently selected item inside a row ViewHolder.

@Nullable Presenter.ViewHolder

Return ViewHolder of currently selected item inside a row ViewHolder.

int

Gets selected item position in adapter.

Inherited methods

From androidx.leanback.widget.FacetProvider
abstract @Nullable Object
getFacet(@NonNull Class<Object> facetClass)

Queries optional implemented facet.

From androidx.leanback.widget.Presenter.ViewHolder
final Object
getFacet(Class<Object> facetClass)

Queries optional implemented facet.

final void
setFacet(Class<Object> facetClass, Object facetImpl)

Sets dynamic implemented facet in addition to basic ViewHolder functions.

From androidx.leanback.widget.RowPresenter.ViewHolder
final RowHeaderPresenter.ViewHolder

Returns the view holder for the Row header for this Row.

final BaseOnItemViewClickedListener

Returns the listener for item click event.

final BaseOnItemViewSelectedListener

Returns the listener for item or row selection.

View.OnKeyListener

Returns the key listener.

final Row

Returns the row bound to this ViewHolder.

final Object

Returns the Row object bound to this ViewHolder.

final float

Returns the current selection level of the Row.

final boolean

Returns whether the Row is in its expanded state.

final boolean

Returns whether the Row is selected.

final void
setActivated(boolean activated)

Sets the row view's activated status.

final void

Sets the listener for item click event.

final void

Sets the listener for item or row selection.

void

Sets a key listener.

final void

Synchronizes the activated status of view to the last value passed through setActivated.

Public constructors

ViewHolder

Added in 1.1.0
public ViewHolder(
    @NonNull View rootView,
    @NonNull HorizontalGridView gridView,
    @NonNull ListRowPresenter p
)

Public methods

getBridgeAdapter

Added in 1.1.0
public final @NonNull ItemBridgeAdapter getBridgeAdapter()

Gets ItemBridgeAdapter that creates the list of items.

Returns
@NonNull ItemBridgeAdapter

ItemBridgeAdapter that creates the list of items.

getGridView

Added in 1.1.0
public final @NonNull HorizontalGridView getGridView()

Gets HorizontalGridView that shows a list of items.

Returns
@NonNull HorizontalGridView

HorizontalGridView that shows a list of items.

getItemViewHolder

Added in 1.1.0
public @Nullable Presenter.ViewHolder getItemViewHolder(int position)

Gets ViewHolder at a position in adapter. Returns null if the item does not exist or the item is not bound to a view.

Parameters
int position

Position of the item in adapter.

Returns
@Nullable Presenter.ViewHolder

ViewHolder bounds to the item.

getListRowPresenter

Added in 1.1.0
public final @NonNull ListRowPresenter getListRowPresenter()

Gets ListRowPresenter that creates this ViewHolder.

Returns
@NonNull ListRowPresenter

ListRowPresenter that creates this ViewHolder.

getSelectedItem

public @Nullable Object getSelectedItem()

Return currently selected item inside a row ViewHolder.

Returns
@Nullable Object

The selected item.

getSelectedItemViewHolder

public @Nullable Presenter.ViewHolder getSelectedItemViewHolder()

Return ViewHolder of currently selected item inside a row ViewHolder.

Returns
@Nullable Presenter.ViewHolder

The selected item's ViewHolder.

getSelectedPosition

Added in 1.1.0
public int getSelectedPosition()

Gets selected item position in adapter.

Returns
int

Selected item position in adapter.