Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

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 Unit

Sets the description for the current header item.

String!

Returns the name of this header item.

Long

Returns a unique identifier for this item.

open CharSequence!

Returns the description for the current row.

open Unit
setContentDescription(contentDescription: CharSequence!)

Sets optional content description for the HeaderItem.

open CharSequence!

Returns optional content description for the HeaderItem.

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

setDescription

open fun setDescription(description: CharSequence!): Unit

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

getName

fun getName(): String!

Returns the name of this header item.

getId

fun getId(): Long

Returns a unique identifier for this item.

getDescription

open fun getDescription(): CharSequence!

Returns the description for the current row.

setContentDescription

open fun setContentDescription(contentDescription: CharSequence!): Unit

Sets optional content description for the HeaderItem.

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

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.