Builder

class Builder
kotlin.Any
   ↳ 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.Builder!
setId(programId: Long)

Sets a unique id for this program.

PreviewProgram.Builder!
setEpisodeNumber(episodeNumber: Int)

Sets the episode number in a season for this episode for a series.

PreviewProgram.Builder!
setEpisodeNumber(episodeNumber: String!, numericalEpisodeNumber: Int)

Sets the episode number in a season for this episode for a series.

PreviewProgram.Builder!
setPreviewAudioUri(previewAudioUri: Uri!)

Sets a URI for the preview audio.

PreviewProgram.Builder!
setType(type: Int)

Sets the type of this program content.

PreviewProgram.Builder!

Sets the video width of the program.

PreviewProgram.Builder!
setSeasonNumber(seasonNumber: Int)

Sets the season number for this episode for a series.

PreviewProgram.Builder!
setSeasonNumber(seasonNumber: String!, numericalSeasonNumber: Int)

Sets the season number for this episode for a series.

PreviewProgram.Builder!
setChannelId(channelId: Long)

Sets the ID of the Channel that contains this program.

PreviewProgram.Builder!

Sets the internal provider flag2 for the program.

PreviewProgram.Builder!
setGenre(genre: String!)

Sets the genre for this program.

PreviewProgram.Builder!
setLogoUri(logoUri: Uri!)

Sets the URI for the logo of this TV program.

PreviewProgram!

PreviewProgram.Builder!

Sets the video height of the program.

PreviewProgram.Builder!

Set the TV series item type for this program.

PreviewProgram.Builder!
setTitle(title: String!)

Sets the title of this program.

PreviewProgram.Builder!

Sets the internal provider data for the program as raw bytes.

PreviewProgram.Builder!
setInteractionType(interactionType: Int)

Sets the type of interaction for this TV program.

PreviewProgram.Builder!

Sets whether this TV program is live or not.

PreviewProgram.Builder!
setTransient(transientValue: Boolean)

Sets whether this program is transient or not.

PreviewProgram.Builder!
setAuthor(author: String!)

Sets the author or artist of this content.

PreviewProgram.Builder!
setContentId(contentId: String!)

Sets the content ID for this program.

PreviewProgram.Builder!

Sets the aspect ratio of the poster art for this TV program.

PreviewProgram.Builder!
setPreviewVideoUri(previewVideoUri: Uri!)

Sets a URI for the preview video.

PreviewProgram.Builder!
setPosterArtUri(posterArtUri: Uri!)

Sets the large poster art of the program.

PreviewProgram.Builder!

Sets the internal provider flag1 for the program.

PreviewProgram.Builder!

Sets the aspect ratio of the thumbnail for this TV program.

PreviewProgram.Builder!
setDescription(description: String!)

Sets a brief description of the program.

PreviewProgram.Builder!

Sets the last playback duration (in milliseconds) of the preview video.

PreviewProgram.Builder!

Sets the content ratings for this program.

PreviewProgram.Builder!

Sets the end time of the program (for live programs).

PreviewProgram.Builder!
setAudioLanguages(audioLanguages: Array<String!>!)

Sets the available audio languages for this program as an array of strings.

PreviewProgram.Builder!

Sets the internal provider flag4 for the program.

PreviewProgram.Builder!
setReviewRatingStyle(reviewRatingStyle: Int)

Sets the review rating score style used for #setReviewRating.

PreviewProgram.Builder!
setItemCount(itemCount: Int)

Sets the count of the items included in this TV program.

PreviewProgram.Builder!

Sets external ID for the program.

PreviewProgram.Builder!
setWeight(weight: Int)

Sets the weight of the preview program within the channel.

PreviewProgram.Builder!
setPackageName(packageName: String!)

Sets the package name for this program.

PreviewProgram.Builder!

Sets the starting price of this TV program.

PreviewProgram.Builder!

Sets the offer price of this TV program.

PreviewProgram.Builder!
setIntent(intent: Intent!)

Sets the intent which is launched when the program is selected.

PreviewProgram.Builder!
setSeasonTitle(seasonTitle: String!)

Sets a custom name for the season, if applicable.

PreviewProgram.Builder!
setSearchable(searchable: Boolean)

Sets whether this channel can be searched for in other applications.

PreviewProgram.Builder!
setIntentUri(intentUri: Uri!)

Sets the intent URI which is launched when the program is selected.

PreviewProgram.Builder!
setThumbnailUri(thumbnailUri: Uri!)

Sets a small thumbnail of the program.

PreviewProgram.Builder!
setReleaseDate(releaseDate: String!)

Sets the release date of this TV program.

PreviewProgram.Builder!
setReleaseDate(releaseDate: Date!)

Sets the release date of this TV program.

PreviewProgram.Builder!

Sets the start time of the program (for live programs).

PreviewProgram.Builder!

Sets the last playback position (in milliseconds) of the preview video.

PreviewProgram.Builder!

Sets the internal provider flag3 for the program.

PreviewProgram.Builder!
setAvailability(availability: Int)

Sets the availability of this TV program.

PreviewProgram.Builder!
setBrowsable(browsable: Boolean)

Sets whether this TV program is browsable or not.

PreviewProgram.Builder!
setLongDescription(longDescription: String!)

Sets a longer description of a program if one exists.

PreviewProgram.Builder!
setLogoContentDescription(logoContentDescription: String!)

Sets the logo's content description for this program.

PreviewProgram.Builder!

Sets the genres of the program.

PreviewProgram.Builder!
setEpisodeTitle(episodeTitle: String!)

Sets the title of this particular episode for a series.

PreviewProgram.Builder!
setReviewRating(reviewRating: String!)

Sets the review rating score for this program.

PreviewProgram.Builder!
setInteractionCount(interactionCount: Long)

Sets the interaction count for this program.

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

setId

fun setId(programId: Long): PreviewProgram.Builder!

Sets a unique id for this program.

Parameters
programId Long: The ID for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setEpisodeNumber

fun setEpisodeNumber(episodeNumber: Int): PreviewProgram.Builder!

Sets the episode number in a season for this episode for a series.

Parameters
episodeNumber Int: The value of episode display number for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setEpisodeNumber

fun setEpisodeNumber(episodeNumber: String!, numericalEpisodeNumber: Int): PreviewProgram.Builder!

Sets the episode number in a season for this episode for a series.

Parameters
episodeNumber String!: The value of episode display number for the program.
numericalEpisodeNumber String!: An integer value for androidx.tvprovider.media.tv.TvContractCompat.Programs#COLUMN_EPISODE_NUMBER which will be used for API Level 23 and below.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setPreviewAudioUri

fun setPreviewAudioUri(previewAudioUri: Uri!): PreviewProgram.Builder!

Sets a URI for the preview audio.

Parameters
previewAudioUri Uri!: The preview audio URI for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setVideoWidth

fun setVideoWidth(width: Int): PreviewProgram.Builder!

Sets the video width of the program.

Parameters
width Int: The video width for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setSeasonNumber

fun setSeasonNumber(seasonNumber: Int): PreviewProgram.Builder!

Sets the season number for this episode for a series.

Parameters
seasonNumber Int: The season display number for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setSeasonNumber

fun setSeasonNumber(seasonNumber: String!, numericalSeasonNumber: Int): PreviewProgram.Builder!

Sets the season number for this episode for a series.

Parameters
seasonNumber String!: The season display number for the program.
numericalSeasonNumber String!: An integer value for androidx.tvprovider.media.tv.TvContractCompat.Programs#COLUMN_SEASON_NUMBER which will be used for API Level 23 and below.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

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.

setInternalProviderFlag2

fun setInternalProviderFlag2(flag: Long): PreviewProgram.Builder!

Sets the internal provider flag2 for the program.

Parameters
flag Long: The second internal provider flag for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setGenre

fun setGenre(genre: String!): PreviewProgram.Builder!

Sets the genre for this program.

Parameters
genre String!: The genre for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setLogoUri

fun setLogoUri(logoUri: Uri!): PreviewProgram.Builder!

Sets the URI for the logo of this TV program.

Parameters
logoUri Uri!: The logo URI for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

build

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

setVideoHeight

fun setVideoHeight(height: Int): PreviewProgram.Builder!

Sets the video height of the program.

Parameters
height Int: The video height for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setTvSeriesItemType

fun setTvSeriesItemType(type: Int): PreviewProgram.Builder!

Set the TV series item type for this program.

Parameters
type Int: the TV series item type
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

See Also

  • PreviewProgramColumns#TV_SERIES_ITEM_TYPE_EPISODEPreviewProgramColumns#TV_SERIES_ITEM_TYPE_CHAPTER

setTitle

fun setTitle(title: String!): PreviewProgram.Builder!

Sets the title of this program. For a series, this is the series title.

Parameters
title String!: The title for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setInternalProviderData

fun setInternalProviderData(data: ByteArray!): PreviewProgram.Builder!

Sets the internal provider data for the program as raw bytes.

Parameters
data ByteArray!: The internal provider data for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setLive

fun setLive(live: Boolean): PreviewProgram.Builder!

Sets whether this TV program is live or not.

Parameters
live Boolean: Whether the program is live or not.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setTransient

fun setTransient(transientValue: Boolean): PreviewProgram.Builder!

Sets whether this program is transient or not.

Parameters
transientValue Boolean: Whether the program is transient or not.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setAuthor

fun setAuthor(author: String!): PreviewProgram.Builder!

Sets the author or artist of this content.

Parameters
author String!: The author of the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setContentId

fun setContentId(contentId: String!): PreviewProgram.Builder!

Sets the content ID for this program.

Parameters
contentId String!: The content ID for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setPreviewVideoUri

fun setPreviewVideoUri(previewVideoUri: Uri!): PreviewProgram.Builder!

Sets a URI for the preview video.

Parameters
previewVideoUri Uri!: The preview video URI for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setPosterArtUri

fun setPosterArtUri(posterArtUri: Uri!): PreviewProgram.Builder!

Sets the large poster art of the program.

Parameters
posterArtUri Uri!: The poster art URI for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setInternalProviderFlag1

fun setInternalProviderFlag1(flag: Long): PreviewProgram.Builder!

Sets the internal provider flag1 for the program.

Parameters
flag Long: The first internal provider flag for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setDescription

fun setDescription(description: String!): PreviewProgram.Builder!

Sets a brief description of the program. For a series, this would be a brief description of the episode.

Parameters
description String!: The short description for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setDurationMillis

fun setDurationMillis(duration: Int): PreviewProgram.Builder!

Sets the last playback duration (in milliseconds) of the preview video.

Parameters
duration Int: The duration the program in millis.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setContentRatings

fun setContentRatings(contentRatings: Array<TvContentRating!>!): PreviewProgram.Builder!

Sets the content ratings for this program.

Parameters
contentRatings Array<TvContentRating!>!: An array of android.media.tv.TvContentRating that apply to this program which will be flattened to a String to store in a database.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setEndTimeUtcMillis

fun setEndTimeUtcMillis(endTime: Long): PreviewProgram.Builder!

Sets the end time of the program (for live programs).

Parameters
endTime Long: The end time for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setAudioLanguages

fun setAudioLanguages(audioLanguages: Array<String!>!): PreviewProgram.Builder!

Sets the available audio languages for this program as an array of strings.

Parameters
audioLanguages Array<String!>!: An array of audio languages, in ISO 639-1 or 639-2/T codes, that apply to this program which will be stored in a database.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setInternalProviderFlag4

fun setInternalProviderFlag4(flag: Long): PreviewProgram.Builder!

Sets the internal provider flag4 for the program.

Parameters
flag Long: The forth internal provider flag for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setReviewRatingStyle

fun setReviewRatingStyle(reviewRatingStyle: Int): PreviewProgram.Builder!

Sets the review rating score style used for #setReviewRating.

Parameters
reviewRatingStyle Int: The reviewing rating style for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setItemCount

fun setItemCount(itemCount: Int): PreviewProgram.Builder!

Sets the count of the items included in this TV program.

Parameters
itemCount Int: The item count for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setInternalProviderId

fun setInternalProviderId(externalId: String!): PreviewProgram.Builder!

Sets external ID for the program.

Parameters
externalId String!: The internal provider ID for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

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.

setPackageName

fun setPackageName(packageName: String!): PreviewProgram.Builder!

Sets the package name for this program.

Parameters
packageName String!: The package name for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setStartingPrice

fun setStartingPrice(price: String!): PreviewProgram.Builder!

Sets the starting price of this TV program.

Parameters
price String!: The starting price of the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setOfferPrice

fun setOfferPrice(price: String!): PreviewProgram.Builder!

Sets the offer price of this TV program.

Parameters
price String!: The offer price of the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setIntent

fun setIntent(intent: Intent!): PreviewProgram.Builder!

Sets the intent which is launched when the program is selected.

Parameters
intent Intent!: The Intent to be executed when the preview program is selected
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setSeasonTitle

fun setSeasonTitle(seasonTitle: String!): PreviewProgram.Builder!

Sets a custom name for the season, if applicable.

Parameters
seasonTitle String!: The season title for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setSearchable

fun setSearchable(searchable: Boolean): PreviewProgram.Builder!

Sets whether this channel can be searched for in other applications.

Parameters
searchable Boolean: Whether the program is searchable or not.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setIntentUri

fun setIntentUri(intentUri: Uri!): PreviewProgram.Builder!

Sets the intent URI which is launched when the program is selected.

Parameters
intentUri Uri!: The intent URI for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setThumbnailUri

fun setThumbnailUri(thumbnailUri: Uri!): PreviewProgram.Builder!

Sets a small thumbnail of the program.

Parameters
thumbnailUri Uri!: The thumbnail URI for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setReleaseDate

fun setReleaseDate(releaseDate: String!): PreviewProgram.Builder!

Sets the release date of this TV program.

The value should be in one of the following formats: "yyyy", "yyyy-MM-dd", and "yyyy-MM-ddTHH:mm:ssZ" (UTC in ISO 8601).

Parameters
releaseDate String!: The release date of the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setReleaseDate

fun setReleaseDate(releaseDate: Date!): PreviewProgram.Builder!

Sets the release date of this TV program.

Parameters
releaseDate Date!: The release date of the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setStartTimeUtcMillis

fun setStartTimeUtcMillis(startTime: Long): PreviewProgram.Builder!

Sets the start time of the program (for live programs).

Parameters
startTime Long: The start time for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setLastPlaybackPositionMillis

fun setLastPlaybackPositionMillis(position: Int): PreviewProgram.Builder!

Sets the last playback position (in milliseconds) of the preview video.

Parameters
position Int: The last playback posirion for the program in millis.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setInternalProviderFlag3

fun setInternalProviderFlag3(flag: Long): PreviewProgram.Builder!

Sets the internal provider flag3 for the program.

Parameters
flag Long: The third internal provider flag for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setAvailability

fun setAvailability(availability: Int): PreviewProgram.Builder!

Sets the availability of this TV program.

The value should match one of the followings: .PreviewPrograms#AVAILABILITY_AVAILABLE, .PreviewPrograms#AVAILABILITY_FREE_WITH_SUBSCRIPTION, .PreviewPrograms#AVAILABILITY_PAID_CONTENT, .PreviewPrograms#AVAILABILITY_PURCHASED, and .PreviewPrograms#AVAILABILITY_FREE.

Parameters
availability Int: The availability of the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setBrowsable

fun setBrowsable(browsable: Boolean): PreviewProgram.Builder!

Sets whether this TV program is browsable or not.

Parameters
browsable Boolean: Whether the program is browsable or not.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setLongDescription

fun setLongDescription(longDescription: String!): PreviewProgram.Builder!

Sets a longer description of a program if one exists.

Parameters
longDescription String!: The long description for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setLogoContentDescription

fun setLogoContentDescription(logoContentDescription: String!): PreviewProgram.Builder!

Sets the logo's content description for this program.

Parameters
logoContentDescription String!: The content description for the logo displayed in the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setCanonicalGenres

fun setCanonicalGenres(genres: Array<String!>!): PreviewProgram.Builder!

Sets the genres of the program.

Parameters
genres Array<String!>!: An array of androidx.tvprovider.media.tv.TvContractCompat.Programs.Genres that apply to the program which will be flattened to a String to store in a database.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setEpisodeTitle

fun setEpisodeTitle(episodeTitle: String!): PreviewProgram.Builder!

Sets the title of this particular episode for a series.

Parameters
episodeTitle String!: The episode title for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setReviewRating

fun setReviewRating(reviewRating: String!): PreviewProgram.Builder!

Sets the review rating score for this program.

The format of the value is dependent on the review rating style. If the style is based on "stars", the value should be a real number between 0.0 and 5.0. (e.g. "4.5") If the style is based on "thumbs up/down", the value should be two integers, one for thumbs-up count and the other for thumbs-down count, with a comma between them. (e.g. "200,40") If the style is base on "percentage", the value should be a real number between 0 and 100. (e.g. "99.9")

Parameters
reviewRating String!: The value of the review rating for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.

setInteractionCount

fun setInteractionCount(interactionCount: Long): PreviewProgram.Builder!

Sets the interaction count for this program.

Parameters
interactionCount Long: The interaction count for the program.
Return
PreviewProgram.Builder!: This Builder object to allow for chaining of calls to builder methods.