RowsSupportFragment

open class RowsSupportFragment : BaseRowSupportFragment, BrowseSupportFragment.MainFragmentRowsAdapterProvider, BrowseSupportFragment.MainFragmentAdapterProvider
androidx.leanback.app.RowsSupportFragment

An ordered set of rows of leanback widgets.

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

Summary

Nested classes
open

open

The adapter that RowsSupportFragment implements BrowseSupportFragment.

Public constructors

An ordered set of rows of leanback widgets.

Public methods
open Unit

Sets an item clicked listener on the fragment.

open Boolean

open Unit

open Unit
setAlignment(windowAlignOffsetFromTop: Int)

open Unit

Sets an item selection listener.

open Unit

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

open Unit
setSelectedPosition(rowPosition: Int, smooth: Boolean, rowHolderTask: Presenter.ViewHolderTask!)

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

open RowPresenter.ViewHolder!

Find row ViewHolder by position in adapter.

open Unit
setExpand(expand: Boolean)

Set the visibility of titles/hovercard of browse rows.

open BrowseSupportFragment.MainFragmentRowsAdapter<Fragment!>!

open BaseOnItemViewSelectedListener<Any!>!

Returns an item selection listener.

open Unit
onViewCreated(@NonNull view: View, @Nullable savedInstanceState: Bundle?)

open Unit
onCreate(savedInstanceState: Bundle?)

open Unit

open Boolean

open RowPresenter.ViewHolder!
getRowViewHolder(position: Int)

Get row ViewHolder at adapter position.

open BrowseSupportFragment.MainFragmentAdapter<Fragment!>!

open Unit

open BaseOnItemViewClickedListener<Any!>!

Returns the item clicked listener.

Protected methods
open VerticalGridView!

Public constructors

<init>

RowsSupportFragment()

An ordered set of rows of leanback widgets.

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

Public methods

setOnItemViewClickedListener

open fun setOnItemViewClickedListener(listener: BaseOnItemViewClickedListener<Any!>!): Unit

Sets an item clicked listener on the fragment. OnItemViewClickedListener will override View.OnClickListener that item presenter sets during Presenter#onCreateViewHolder(ViewGroup). So in general, developer should choose one of the listeners but not both.

isScrolling

open fun isScrolling(): Boolean

onTransitionEnd

open fun onTransitionEnd(): Unit

setAlignment

open fun setAlignment(windowAlignOffsetFromTop: Int): Unit

setOnItemViewSelectedListener

open fun setOnItemViewSelectedListener(listener: BaseOnItemViewSelectedListener<Any!>!): Unit

Sets an item selection listener.

setEntranceTransitionState

open fun setEntranceTransitionState(afterTransition: Boolean): Unit

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

setSelectedPosition

open fun setSelectedPosition(rowPosition: Int, smooth: Boolean, rowHolderTask: Presenter.ViewHolderTask!): Unit

Selects a Row and perform an optional task on the Row. For example setSelectedPosition(10, true, new ListRowPresenterSelectItemViewHolderTask(5)) Scroll to 11th row and selects 6th item on that row. The method will be ignored if RowsSupportFragment has not been created (i.e. before onCreateView(LayoutInflater, * ViewGroup, Bundle)).

Parameters
rowPosition Int: Which row to select.
smooth Int: True to scroll to the row, false for no animation.
rowHolderTask Int: Task to perform on the Row.

findRowViewHolderByPosition

open fun findRowViewHolderByPosition(position: Int): RowPresenter.ViewHolder!

Find row ViewHolder by position in adapter.

Parameters
position Int: Position of row.
Return
RowPresenter.ViewHolder!: ViewHolder of Row.

setExpand

open fun setExpand(expand: Boolean): Unit

Set the visibility of titles/hovercard of browse rows.

getMainFragmentRowsAdapter

open fun getMainFragmentRowsAdapter(): BrowseSupportFragment.MainFragmentRowsAdapter<Fragment!>!

getOnItemViewSelectedListener

open fun getOnItemViewSelectedListener(): BaseOnItemViewSelectedListener<Any!>!

Returns an item selection listener.

onViewCreated

open fun onViewCreated(@NonNull view: View, @Nullable savedInstanceState: Bundle?): Unit

onCreate

open fun onCreate(savedInstanceState: Bundle?): Unit

enableRowScaling

open fun enableRowScaling(enable: Boolean): Unit
Parameters
enable Boolean: true to enable row scaling

onTransitionPrepare

open fun onTransitionPrepare(): Boolean

getRowViewHolder

open fun getRowViewHolder(position: Int): RowPresenter.ViewHolder!

Get row ViewHolder at adapter position. Returns null if the row object is not in adapter or the row object has not been bound to a row view.

Parameters
position Int: Position of row in adapter.
Return
RowPresenter.ViewHolder!: Row ViewHolder at a given adapter position.

getMainFragmentAdapter

open fun getMainFragmentAdapter(): BrowseSupportFragment.MainFragmentAdapter<Fragment!>!

onDestroyView

open fun onDestroyView(): Unit

getOnItemViewClickedListener

open fun getOnItemViewClickedListener(): BaseOnItemViewClickedListener<Any!>!

Returns the item clicked listener.

Protected methods

findGridViewFromRoot

protected open fun findGridViewFromRoot(view: View!): VerticalGridView!