RowsFragment

Added in 1.1.0
Deprecated in 1.1.0

class RowsFragment : Fragment, BrowseFragment.MainFragmentRowsAdapterProvider, BrowseFragment.MainFragmentAdapterProvider


An ordered set of rows of leanback widgets.

A RowsFragment 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

Public constructors

Public functions

Unit

This function is deprecated.

use enableRowScaling instead.

RowPresenter.ViewHolder!

Find row ViewHolder by position in adapter.

ObjectAdapter!

Returns the Adapter that represents list of rows.

ItemBridgeAdapter!

Returns the RecyclerView.Adapter that wraps getAdapter.

BrowseFragment.MainFragmentAdapter!

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

BrowseFragment.MainFragmentRowsAdapter!

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

BaseOnItemViewClickedListener!

Returns the item clicked listener.

BaseOnItemViewSelectedListener!

Returns an item selection listener.

PresenterSelector!

Get the presenter selector used to create and bind views.

RowPresenter.ViewHolder!
getRowViewHolder(position: Int)

Get row ViewHolder at adapter position.

Int

Gets position of currently selected row.

VerticalGridView!
Boolean
View?
onCreateView(
    inflater: LayoutInflater!,
    container: ViewGroup?,
    savedInstanceState: Bundle!
)

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
Boolean
Unit
Unit
onViewCreated(view: View, savedInstanceState: Bundle?)

This function is deprecated.

Unit
setAdapter(rowsAdapter: ObjectAdapter!)

Sets the adapter that represents a list of rows.

Unit
setAlignment(windowAlignOffsetFromTop: Int)
Unit

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

Unit
setExpand(expand: Boolean)

Set the visibility of titles/hovercard of browse rows.

Unit

Sets an item clicked listener on the fragment.

Unit

Sets an item selection listener.

Unit

Set the presenter selector used to create and bind views.

Unit

Sets the selected row position with smooth animation.

Unit
setSelectedPosition(position: Int, smooth: Boolean)

Sets the selected row position.

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

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

Protected functions

VerticalGridView!

Inherited functions

From android.app.Fragment
Unit
dump(
    prefix: String!,
    fd: FileDescriptor!,
    writer: PrintWriter!,
    args: Array<String!>!
)

This function is deprecated.

Boolean
equals(o: Any!)

This function is deprecated.

Activity!

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Bundle!

This function is deprecated.

FragmentManager!

This function is deprecated.

Context!

This function is deprecated.

Transition!

This function is deprecated.

Transition!

This function is deprecated.

FragmentManager!

This function is deprecated.

Any!

This function is deprecated.

Int

This function is deprecated.

LayoutInflater!

This function is deprecated.

LoaderManager!

This function is deprecated.

Fragment!

This function is deprecated.

Transition!

This function is deprecated.

Resources!

This function is deprecated.

Boolean

This function is deprecated.

Transition!

This function is deprecated.

Transition!

This function is deprecated.

Transition!

This function is deprecated.

String!
getString(resId: Int)

This function is deprecated.

String!

This function is deprecated.

Fragment!

This function is deprecated.

Int

This function is deprecated.

CharSequence!
getText(resId: Int)

This function is deprecated.

Boolean

This function is deprecated.

View!

This function is deprecated.

Int

This function is deprecated.

java-static Fragment!
instantiate(context: Context!, fname: String!)

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Unit
onActivityCreated(savedInstanceState: Bundle!)

This function is deprecated.

Unit
onActivityResult(requestCode: Int, resultCode: Int, data: Intent!)

This function is deprecated.

Unit
onAttach(context: Context!)

This function is deprecated.

Unit
onAttachFragment(childFragment: Fragment!)

This function is deprecated.

Unit

This function is deprecated.

Boolean

This function is deprecated.

Unit
onCreate(savedInstanceState: Bundle!)

This function is deprecated.

Animator!
onCreateAnimator(transit: Int, enter: Boolean, nextAnim: Int)

This function is deprecated.

Unit
onCreateContextMenu(
    menu: ContextMenu!,
    v: View!,
    menuInfo: ContextMenu.ContextMenuInfo!
)

This function is deprecated.

Unit
onCreateOptionsMenu(menu: Menu!, inflater: MenuInflater!)

This function is deprecated.

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

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

LayoutInflater!
onGetLayoutInflater(savedInstanceState: Bundle!)

This function is deprecated.

Unit

This function is deprecated.

Unit
onInflate(attrs: AttributeSet!, savedInstanceState: Bundle!)

This function is deprecated.

Unit

This function is deprecated.

Unit
onMultiWindowModeChanged(
    isInMultiWindowMode: Boolean,
    newConfig: Configuration!
)

This function is deprecated.

Boolean

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
onPictureInPictureModeChanged(
    isInPictureInPictureMode: Boolean,
    newConfig: Configuration!
)

This function is deprecated.

Unit

This function is deprecated.

Unit
onRequestPermissionsResult(
    requestCode: Int,
    permissions: Array<String!>!,
    grantResults: IntArray!
)

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
onTrimMemory(level: Int)

This function is deprecated.

Unit
onViewCreated(view: View!, savedInstanceState: Bundle!)

This function is deprecated.

Unit
onViewStateRestored(savedInstanceState: Bundle!)

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
requestPermissions(permissions: Array<String!>!, requestCode: Int)

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
setMenuVisibility(menuVisible: Boolean)

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
setTargetFragment(fragment: Fragment!, requestCode: Int)

This function is deprecated.

Unit
setUserVisibleHint(isVisibleToUser: Boolean)

This function is deprecated.

Boolean

This function is deprecated.

Unit

This function is deprecated.

Unit
startActivityForResult(intent: Intent!, requestCode: Int)

This function is deprecated.

Unit
startIntentSenderForResult(
    intent: IntentSender!,
    requestCode: Int,
    fillInIntent: Intent!,
    flagsMask: Int,
    flagsValues: Int,
    extraFlags: Int,
    options: Bundle!
)

This function is deprecated.

Unit

This function is deprecated.

String!

This function is deprecated.

Unit

This function is deprecated.

Public constructors

RowsFragment

Added in 1.1.0
Deprecated in 1.1.0
RowsFragment()

Public functions

enableRowScaling

Added in 1.1.0
Deprecated in 1.1.0
fun enableRowScaling(enable: Boolean): Unit
Parameters
enable: Boolean

true to enable row scaling

findRowViewHolderByPosition

Added in 1.1.0
Deprecated in 1.1.0
fun findRowViewHolderByPosition(position: Int): RowPresenter.ViewHolder!

Find row ViewHolder by position in adapter.

Parameters
position: Int

Position of row.

Returns
RowPresenter.ViewHolder!

ViewHolder of Row.

getAdapter

Added in 1.1.0
Deprecated in 1.1.0
fun getAdapter(): ObjectAdapter!

Returns the Adapter that represents list of rows.

Returns
ObjectAdapter!

Adapter that represents list of rows.

getBridgeAdapter

Added in 1.1.0
Deprecated in 1.1.0
fun getBridgeAdapter(): ItemBridgeAdapter!

Returns the RecyclerView.Adapter that wraps getAdapter.

Returns
ItemBridgeAdapter!

The RecyclerView.Adapter that wraps getAdapter.

getMainFragmentAdapter

Added in 1.2.0-alpha04
Deprecated in 1.2.0-alpha04
fun getMainFragmentAdapter(): BrowseFragment.MainFragmentAdapter!

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

getMainFragmentRowsAdapter

Added in 1.2.0-alpha04
Deprecated in 1.2.0-alpha04
fun getMainFragmentRowsAdapter(): BrowseFragment.MainFragmentRowsAdapter!

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

getOnItemViewClickedListener

Added in 1.1.0
Deprecated in 1.1.0
fun getOnItemViewClickedListener(): BaseOnItemViewClickedListener!

Returns the item clicked listener.

getOnItemViewSelectedListener

Added in 1.1.0
Deprecated in 1.1.0
fun getOnItemViewSelectedListener(): BaseOnItemViewSelectedListener!

Returns an item selection listener.

getPresenterSelector

Added in 1.1.0
Deprecated in 1.1.0
fun getPresenterSelector(): PresenterSelector!

Get the presenter selector used to create and bind views.

getRowViewHolder

Added in 1.1.0
Deprecated in 1.1.0
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.

Returns
RowPresenter.ViewHolder!

Row ViewHolder at a given adapter position.

getSelectedPosition

Added in 1.1.0
Deprecated in 1.1.0
fun getSelectedPosition(): Int

Gets position of currently selected row.

Returns
Int

Position of currently selected row.

getVerticalGridView

Added in 1.1.0
Deprecated in 1.1.0
fun getVerticalGridView(): VerticalGridView!

isScrolling

Added in 1.1.0
Deprecated in 1.1.0
fun isScrolling(): Boolean

onCreateView

Added in 1.1.0
Deprecated in 1.1.0
fun onCreateView(
    inflater: LayoutInflater!,
    container: ViewGroup?,
    savedInstanceState: Bundle!
): View?

onDestroyView

Added in 1.1.0
Deprecated in 1.1.0
fun onDestroyView(): Unit

onSaveInstanceState

Added in 1.1.0
Deprecated in 1.1.0
fun onSaveInstanceState(outState: Bundle!): Unit

onTransitionEnd

Added in 1.1.0
Deprecated in 1.1.0
fun onTransitionEnd(): Unit

onTransitionPrepare

Added in 1.1.0
Deprecated in 1.1.0
fun onTransitionPrepare(): Boolean

onTransitionStart

Added in 1.1.0
Deprecated in 1.1.0
fun onTransitionStart(): Unit

onViewCreated

Added in 1.1.0
Deprecated in 1.1.0
fun onViewCreated(view: View, savedInstanceState: Bundle?): Unit

setAdapter

Added in 1.1.0
Deprecated in 1.1.0
fun setAdapter(rowsAdapter: ObjectAdapter!): Unit

Sets the adapter that represents a list of rows.

Parameters
rowsAdapter: ObjectAdapter!

Adapter that represents list of rows.

setAlignment

Added in 1.1.0
Deprecated in 1.1.0
fun setAlignment(windowAlignOffsetFromTop: Int): Unit

setEntranceTransitionState

Added in 1.1.0
Deprecated in 1.1.0
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.

setExpand

Added in 1.1.0
Deprecated in 1.1.0
fun setExpand(expand: Boolean): Unit

Set the visibility of titles/hovercard of browse rows.

setOnItemViewClickedListener

Added in 1.1.0
Deprecated in 1.1.0
fun setOnItemViewClickedListener(listener: BaseOnItemViewClickedListener!): Unit

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

setOnItemViewSelectedListener

Added in 1.1.0
Deprecated in 1.1.0
fun setOnItemViewSelectedListener(listener: BaseOnItemViewSelectedListener!): Unit

Sets an item selection listener.

setPresenterSelector

Added in 1.1.0
Deprecated in 1.1.0
fun setPresenterSelector(presenterSelector: PresenterSelector!): Unit

Set the presenter selector used to create and bind views.

setSelectedPosition

Added in 1.1.0
Deprecated in 1.1.0
fun setSelectedPosition(position: Int): Unit

Sets the selected row position with smooth animation.

setSelectedPosition

Added in 1.1.0
Deprecated in 1.1.0
fun setSelectedPosition(position: Int, smooth: Boolean): Unit

Sets the selected row position.

setSelectedPosition

Added in 1.1.0
Deprecated in 1.1.0
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 RowsFragment has not been created (i.e. before onCreateView).

Parameters
rowPosition: Int

Which row to select.

smooth: Boolean

True to scroll to the row, false for no animation.

rowHolderTask: Presenter.ViewHolderTask!

Task to perform on the Row.

Protected functions

findGridViewFromRoot

Added in 1.1.0
Deprecated in 1.1.0
protected fun findGridViewFromRoot(view: View!): VerticalGridView!