Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

Builder

class Builder : Builder<PreviewProgram.Builder!>
androidx.tvprovider.media.tv.PreviewProgram.Builder

This Builder class simplifies the creation of a PreviewProgram object.

Summary

Public constructors

Creates a new Builder object.

Creates a new Builder object with values copied from another Program.

Public methods

PreviewProgram!

PreviewProgram.Builder!
setChannelId(channelId: Long)

Sets the ID of the Channel that contains this program.

PreviewProgram.Builder!
setWeight(weight: Int)

Sets the weight of the preview program within the channel.

Public constructors

<init>

Builder()

Creates a new Builder object.

<init>

Builder(other: PreviewProgram!)

Creates a new Builder object with values copied from another Program.

Parameters
other PreviewProgram!: The Program you're copying from.

Public methods

build

fun build(): PreviewProgram!
Return
PreviewProgram!: A new Program with values supplied by the Builder.

setChannelId

fun setChannelId(channelId: Long): PreviewProgram.Builder!

Sets the ID of the Channel that contains this program.

Parameters
channelId Long: The value of for the program.

setWeight

fun setWeight(weight: Int): PreviewProgram.Builder!

Sets the weight of the preview program within the channel.

Parameters
weight Int: The value of PreviewPrograms#COLUMN_WEIGHT for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.