added in version 22.1.0
belongs to Maven artifact


public class RowsSupportFragment
extends Fragment implements BrowseSupportFragment.MainFragmentRowsAdapterProvider, BrowseSupportFragment.MainFragmentAdapterProvider


An ordered set of rows of leanback widgets.

A RowsSupportFragment renders the elements of its ObjectAdapter as a set of rows in a vertical list. The Adapter's PresenterSelector must maintain subclasses of RowPresenter.


Nested classes

class RowsSupportFragment.MainFragmentAdapter


class RowsSupportFragment.MainFragmentRowsAdapter

The adapter that RowsSupportFragment implements BrowseSupportFragment.MainFragmentRowsAdapter. 

Public constructors


Public methods

void enableRowScaling(boolean enable)

This method was deprecated in API level 24.1.0. use enableRowScaling(boolean) instead.

RowPresenter.ViewHolder findRowViewHolderByPosition(int position)

Find row ViewHolder by position in adapter.

final ObjectAdapter getAdapter()

Returns the Adapter that represents list of rows.

final ItemBridgeAdapter getBridgeAdapter()

Returns the RecyclerView.Adapter that wraps getAdapter().

MainFragmentAdapter getMainFragmentAdapter()

Returns an instance of BrowseSupportFragment.MainFragmentAdapter that BrowseSupportFragment would use to communicate with the target fragment.

MainFragmentRowsAdapter getMainFragmentRowsAdapter()

Returns an instance of BrowseSupportFragment.MainFragmentRowsAdapter that BrowseSupportFragment would use to communicate with the target fragment.

BaseOnItemViewClickedListener getOnItemViewClickedListener()

Returns the item clicked listener.

BaseOnItemViewSelectedListener getOnItemViewSelectedListener()

Returns an item selection listener.

final PresenterSelector getPresenterSelector()

Get the presenter selector used to create and bind views.

RowPresenter.ViewHolder getRowViewHolder(int position)

Get row ViewHolder at adapter position.

int getSelectedPosition()

Gets position of currently selected row.

final VerticalGridView getVerticalGridView()
boolean isScrolling()
void onCreate(Bundle savedInstanceState)

Called to do initial creation of a fragment.

View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)

Called to have the fragment instantiate its user interface view.

void onDestroyView()

Called when the view previously created by onCreateView(LayoutInflater, ViewGroup, Bundle) has been detached from the fragment.

void onSaveInstanceState(Bundle outState)

Called to ask the fragment to save its current dynamic state, so it can later be reconstructed in a new instance of its process is restarted.

void onTransitionEnd()
boolean onTransitionPrepare()
void onTransitionStart()
void onViewCreated(View view, Bundle savedInstanceState)

Called immediately after onCreateView(LayoutInflater, ViewGroup, Bundle) has returned, but before any saved state has been restored in to the view.

final void setAdapter(ObjectAdapter rowsAdapter)

Sets the adapter that represents a list of rows.

void setAlignment(int windowAlignOffsetFromTop)
void setEntranceTransitionState(boolean afterTransition)

For rows that willing to participate entrance transition, this function hide views if afterTransition is true, show views if afterTransition is false.

void setExpand(boolean expand)

Set the visibility of titles/hovercard of browse rows.

void setOnItemViewClickedListener(BaseOnItemViewClickedListener listener)

Sets an item clicked listener on the fragment.

void setOnItemViewSelectedListener(BaseOnItemViewSelectedListener listener)

Sets an item selection listener.

final void setPresenterSelector(PresenterSelector presenterSelector)

Set the presenter selector used to create and bind views.

void setSelectedPosition(int position)

Sets the selected row position with smooth animation.

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

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

void setSelectedPosition(int position, boolean smooth)

Sets the selected row position.

Protected methods

VerticalGridView findGridViewFromRoot(View view)

Inherited methods

From class