Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.
Android 0.0.0 Developer Preview
belongs to Maven artifact androidx.leanback:leanback:1.1.0-alpha01

BrowseSupportFragment.MainFragmentRowsAdapter

public static class BrowseSupportFragment.MainFragmentRowsAdapter
extends Object

java.lang.Object
   ↳ androidx.leanback.app.BrowseSupportFragment.MainFragmentRowsAdapter<T extends androidx.fragment.app.Fragment>


This is used to pass information to RowsSupportFragment or its subclasses. BrowseSupportFragment uses this interface to pass row based interaction events to the target fragment.

Summary

Public constructors

BrowseSupportFragment.MainFragmentRowsAdapter(T fragment)

Public methods

RowPresenter.ViewHolder findRowViewHolderByPosition(int position)
final T getFragment()
int getSelectedPosition()
void setAdapter(ObjectAdapter adapter)

Set the visibility titles/hover of browse rows.

void setOnItemViewClickedListener(OnItemViewClickedListener listener)

Sets an item clicked listener on the fragment.

void setOnItemViewSelectedListener(OnItemViewSelectedListener listener)

Sets an item selection listener.

void setSelectedPosition(int rowPosition, boolean smooth)

Selects a Row.

void setSelectedPosition(int rowPosition, boolean smooth, Presenter.ViewHolderTask rowHolderTask)

Selects a Row and perform an optional task on the Row.

Inherited methods

Public constructors

BrowseSupportFragment.MainFragmentRowsAdapter

public BrowseSupportFragment.MainFragmentRowsAdapter (T fragment)

Parameters
fragment T

Public methods

findRowViewHolderByPosition

public RowPresenter.ViewHolder findRowViewHolderByPosition (int position)

Parameters
position int: Position of Row.

Returns
RowPresenter.ViewHolder Row ViewHolder.

getFragment

public final T getFragment ()

Returns
T

getSelectedPosition

public int getSelectedPosition ()

Returns
int The position of selected row.

setAdapter

public void setAdapter (ObjectAdapter adapter)

Set the visibility titles/hover of browse rows.

Parameters
adapter ObjectAdapter

setOnItemViewClickedListener

public void setOnItemViewClickedListener (OnItemViewClickedListener listener)

Sets an item clicked listener on the fragment.

Parameters
listener OnItemViewClickedListener

setOnItemViewSelectedListener

public void setOnItemViewSelectedListener (OnItemViewSelectedListener listener)

Sets an item selection listener.

Parameters
listener OnItemViewSelectedListener

setSelectedPosition

public void setSelectedPosition (int rowPosition, 
                boolean smooth)

Selects a Row.

Parameters
rowPosition int

smooth boolean

setSelectedPosition

public void setSelectedPosition (int rowPosition, 
                boolean smooth, 
                Presenter.ViewHolderTask rowHolderTask)

Selects a Row and perform an optional task on the Row.

Parameters
rowPosition int

smooth boolean

rowHolderTask Presenter.ViewHolderTask