이제 두 번째 Android 11 개발자 프리뷰를 사용할 수 있습니다. 테스트해 보고 의견을 공유하세요.

Row

open class Row
kotlin.Any
   ↳ androidx.leanback.widget.Row

The base class for all rows. A commonly used subclass is the ListRow. Custom subclasses may define other types of rows.

Summary

Public constructors

<init>(id: Long, headerItem: HeaderItem!)

Constructor for a Row.

<init>(headerItem: HeaderItem!)

Constructor for a Row.

Constructor for a Row.

Public methods

HeaderItem!

Returns the HeaderItem that represents metadata for the row.

Long

Returns a unique identifier for this row.

open Boolean

Returns true if this Row can be rendered in a visible row view, false otherwise.

Unit
setHeaderItem(headerItem: HeaderItem!)

Sets the HeaderItem that represents metadata for the row.

Unit
setId(id: Long)

Sets the id for this row.

Public constructors

<init>

Row(
    id: Long,
    headerItem: HeaderItem!)

Constructor for a Row.

Parameters
id Long: The id of the row.
headerItem HeaderItem!: The HeaderItem for this Row, or null if there is no header.

<init>

Row(headerItem: HeaderItem!)

Constructor for a Row.

Parameters
headerItem HeaderItem!: The HeaderItem for this Row, or null if there is no header.

<init>

Row()

Constructor for a Row.

Public methods

getHeaderItem

fun getHeaderItem(): HeaderItem!

Returns the HeaderItem that represents metadata for the row.

Return
HeaderItem! The HeaderItem for this row, or null if unset.

getId

fun getId(): Long

Returns a unique identifier for this row. This id can come from one of three places:

isRenderedAsRowView

open fun isRenderedAsRowView(): Boolean

Returns true if this Row can be rendered in a visible row view, false otherwise. For example ListRow is rendered by ListRowPresenter. PageRow, SectionRow, DividerRow are rendered as invisible row views.

Return
Boolean True if this Row can be rendered in a visible row view, false otherwise.

setHeaderItem

fun setHeaderItem(headerItem: HeaderItem!): Unit

Sets the HeaderItem that represents metadata for the row.

Parameters
headerItem HeaderItem!: The HeaderItem for this Row, or null if there is no header.

setId

fun setId(id: Long): Unit

Sets the id for this row.

Parameters
id Long: The id of the row.