HeaderItem

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

A header item describes the metadata of a Row, such as a category of media items. May be subclassed to add more information.

Summary

Public constructors

<init>(id: Long, name: String!)

Create a header item.

<init>(name: String!)

Create a header item.

Public methods

open CharSequence!

Returns optional content description for the HeaderItem.

open CharSequence!

Returns the description for the current row.

Long

Returns a unique identifier for this item.

String!

Returns the name of this header item.

open Unit
setContentDescription(contentDescription: CharSequence!)

Sets optional content description for the HeaderItem.

open Unit

Sets the description for the current header item.

Public constructors

<init>

HeaderItem(id: Long, name: String!)

Create a header item. All fields are optional.

<init>

HeaderItem(name: String!)

Create a header item.

Public methods

getContentDescription

open fun getContentDescription(): CharSequence!

Returns optional content description for the HeaderItem. When it is null, getName() should be used for the content description.

Return
CharSequence!: Content description for the HeaderItem.

getDescription

open fun getDescription(): CharSequence!

Returns the description for the current row.

getId

fun getId(): Long

Returns a unique identifier for this item.

getName

fun getName(): String!

Returns the name of this header item.

setContentDescription

open fun setContentDescription(contentDescription: CharSequence!): Unit

Sets optional content description for the HeaderItem.

Parameters
contentDescription CharSequence!: Content description sets on the HeaderItem.

setDescription

open fun setDescription(description: CharSequence!): Unit

Sets the description for the current header item. This will be visible when the row receives focus.