public abstract class

BasePreviewProgram.Builder<T extends BasePreviewProgram.Builder>

extends BaseProgram.Builder<BasePreviewProgram.Builder>

 java.lang.Object

androidx.tvprovider.media.tv.BaseProgram.Builder<BasePreviewProgram.Builder>

↳androidx.tvprovider.media.tv.BasePreviewProgram.Builder<T>

Subclasses:

PreviewProgram.Builder, WatchNextProgram.Builder

Overview

This Builder class simplifies the creation of a BasePreviewProgram object.

Summary

Fields
from BaseProgram.Builder<T>mValues
Constructors
publicBuilder()

Creates a new Builder object.

publicBuilder(BasePreviewProgram other)

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

Methods
public BasePreviewProgram.Builder<T>setAuthor(java.lang.String author)

Sets the author or artist of this content.

public BasePreviewProgram.Builder<T>setAvailability(int availability)

Sets the availability of this TV program.

public BasePreviewProgram.Builder<T>setBrowsable(boolean browsable)

Sets whether this TV program is browsable or not.

public BasePreviewProgram.Builder<T>setContentId(java.lang.String contentId)

Sets the content ID for this program.

public BasePreviewProgram.Builder<T>setDurationMillis(int duration)

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

public BasePreviewProgram.Builder<T>setEndTimeUtcMillis(long endTime)

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

public BasePreviewProgram.Builder<T>setGenre(java.lang.String genre)

Sets the genre for this program.

public BasePreviewProgram.Builder<T>setIntent(Intent intent)

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

public BasePreviewProgram.Builder<T>setIntentUri(Uri intentUri)

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

public BasePreviewProgram.Builder<T>setInteractionCount(long interactionCount)

Sets the interaction count for this program.

public BasePreviewProgram.Builder<T>setInteractionType(int interactionType)

Sets the type of interaction for this TV program.

public BasePreviewProgram.Builder<T>setInternalProviderId(java.lang.String externalId)

Sets external ID for the program.

public BasePreviewProgram.Builder<T>setItemCount(int itemCount)

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

public BasePreviewProgram.Builder<T>setLastPlaybackPositionMillis(int position)

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

public BasePreviewProgram.Builder<T>setLive(boolean live)

Sets whether this TV program is live or not.

public BasePreviewProgram.Builder<T>setLogoContentDescription(java.lang.String logoContentDescription)

Sets the logo's content description for this program.

public BasePreviewProgram.Builder<T>setLogoUri(Uri logoUri)

Sets the URI for the logo of this TV program.

public BasePreviewProgram.Builder<T>setOfferPrice(java.lang.String price)

Sets the offer price of this TV program.

public BasePreviewProgram.Builder<T>setPosterArtAspectRatio(int ratio)

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

public BasePreviewProgram.Builder<T>setPreviewAudioUri(Uri previewAudioUri)

Sets a URI for the preview audio.

public BasePreviewProgram.Builder<T>setPreviewVideoUri(Uri previewVideoUri)

Sets a URI for the preview video.

public BasePreviewProgram.Builder<T>setReleaseDate(java.util.Date releaseDate)

Sets the release date of this TV program.

public BasePreviewProgram.Builder<T>setReleaseDate(java.lang.String releaseDate)

Sets the release date of this TV program.

public BasePreviewProgram.Builder<T>setStartingPrice(java.lang.String price)

Sets the starting price of this TV program.

public BasePreviewProgram.Builder<T>setStartTimeUtcMillis(long startTime)

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

public BasePreviewProgram.Builder<T>setThumbnailAspectRatio(int ratio)

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

public BasePreviewProgram.Builder<T>setTransient(boolean transientValue)

Sets whether this program is transient or not.

public BasePreviewProgram.Builder<T>setTvSeriesItemType(int type)

Set the TV series item type for this program.

public BasePreviewProgram.Builder<T>setType(int type)

Sets the type of this program content.

from BaseProgram.Builder<T>setAudioLanguages, setCanonicalGenres, setContentRatings, setDescription, setEpisodeNumber, setEpisodeNumber, setEpisodeTitle, setId, setInternalProviderData, setInternalProviderFlag1, setInternalProviderFlag2, setInternalProviderFlag3, setInternalProviderFlag4, setLongDescription, setPackageName, setPosterArtUri, setReviewRating, setReviewRatingStyle, setSearchable, setSeasonNumber, setSeasonNumber, setSeasonTitle, setSeriesId, setThumbnailUri, setTitle, setVideoHeight, setVideoWidth
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Creates a new Builder object.

public Builder(BasePreviewProgram other)

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

Parameters:

other: The Program you're copying from.

Methods

public BasePreviewProgram.Builder<T> setInternalProviderId(java.lang.String externalId)

Sets external ID for the program.

Parameters:

externalId: The internal provider ID for the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: .PreviewPrograms#COLUMN_INTERNAL_PROVIDER_ID

public BasePreviewProgram.Builder<T> setPreviewVideoUri(Uri previewVideoUri)

Sets a URI for the preview video.

Parameters:

previewVideoUri: The preview video URI for the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: TvContractCompat.PreviewProgramColumns.COLUMN_PREVIEW_VIDEO_URI

public BasePreviewProgram.Builder<T> setLastPlaybackPositionMillis(int position)

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

Parameters:

position: The last playback posirion for the program in millis.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: .PreviewPrograms#COLUMN_LAST_PLAYBACK_POSITION_MILLIS

public BasePreviewProgram.Builder<T> setDurationMillis(int duration)

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

Parameters:

duration: The duration the program in millis.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: TvContractCompat.PreviewProgramColumns.COLUMN_DURATION_MILLIS

public BasePreviewProgram.Builder<T> setIntentUri(Uri intentUri)

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

Parameters:

intentUri: The intent URI for the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: TvContractCompat.PreviewProgramColumns.COLUMN_INTENT_URI

public BasePreviewProgram.Builder<T> setIntent(Intent intent)

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

Parameters:

intent: The Intent to be executed when the preview program is selected

Returns:

This Builder object to allow for chaining of calls to builder methods.

public BasePreviewProgram.Builder<T> setTransient(boolean transientValue)

Sets whether this program is transient or not.

Parameters:

transientValue: Whether the program is transient or not.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: TvContractCompat.PreviewProgramColumns.COLUMN_TRANSIENT

public BasePreviewProgram.Builder<T> setType(int type)

Sets the type of this program content.

The value should match one of the followings: TvContractCompat.PreviewProgramColumns.TYPE_MOVIE, TvContractCompat.PreviewProgramColumns.TYPE_TV_SERIES, TvContractCompat.PreviewProgramColumns.TYPE_TV_SEASON, TvContractCompat.PreviewProgramColumns.TYPE_TV_EPISODE, TvContractCompat.PreviewProgramColumns.TYPE_CLIP, TvContractCompat.PreviewProgramColumns.TYPE_EVENT, TvContractCompat.PreviewProgramColumns.TYPE_CHANNEL, TvContractCompat.PreviewProgramColumns.TYPE_TRACK, TvContractCompat.PreviewProgramColumns.TYPE_ALBUM, TvContractCompat.PreviewProgramColumns.TYPE_ARTIST, TvContractCompat.PreviewProgramColumns.TYPE_PLAYLIST, TvContractCompat.PreviewProgramColumns.TYPE_STATION, and TvContractCompat.PreviewProgramColumns.TYPE_GAME.

Parameters:

type: The type of the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: TvContractCompat.PreviewProgramColumns.COLUMN_TYPE

public BasePreviewProgram.Builder<T> setPosterArtAspectRatio(int ratio)

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

The value should match one of the followings: TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_16_9, TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_3_2, TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_4_3, TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_1_1, TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_2_3, and .PreviewPrograms#ASPECT_RATIO_MOVIE_POSTER.

Parameters:

ratio: The poster art aspect ratio for the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: .PreviewPrograms#COLUMN_POSTER_ART_ASPECT_RATIO, COLUMN_POSTER_ART_URI

public BasePreviewProgram.Builder<T> setThumbnailAspectRatio(int ratio)

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

The value should match one of the followings: TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_16_9, TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_3_2, TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_4_3, TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_1_1, TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_2_3, and .PreviewPrograms#ASPECT_RATIO_MOVIE_POSTER.

Parameters:

ratio: The thumbnail aspect ratio of the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: .PreviewPrograms#COLUMN_THUMBNAIL_ASPECT_RATIO

public BasePreviewProgram.Builder<T> setLogoUri(Uri logoUri)

Sets the URI for the logo of this TV program.

Parameters:

logoUri: The logo URI for the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: TvContractCompat.PreviewProgramColumns.COLUMN_LOGO_URI

public BasePreviewProgram.Builder<T> setAvailability(int availability)

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: The availability of the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: TvContractCompat.PreviewProgramColumns.COLUMN_AVAILABILITY

public BasePreviewProgram.Builder<T> setStartingPrice(java.lang.String price)

Sets the starting price of this TV program.

Parameters:

price: The starting price of the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: TvContractCompat.PreviewProgramColumns.COLUMN_STARTING_PRICE

public BasePreviewProgram.Builder<T> setOfferPrice(java.lang.String price)

Sets the offer price of this TV program.

Parameters:

price: The offer price of the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: TvContractCompat.PreviewProgramColumns.COLUMN_OFFER_PRICE

public BasePreviewProgram.Builder<T> setReleaseDate(java.lang.String releaseDate)

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: The release date of the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: TvContractCompat.PreviewProgramColumns.COLUMN_RELEASE_DATE

public BasePreviewProgram.Builder<T> setReleaseDate(java.util.Date releaseDate)

Sets the release date of this TV program.

Parameters:

releaseDate: The release date of the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: TvContractCompat.PreviewProgramColumns.COLUMN_RELEASE_DATE

public BasePreviewProgram.Builder<T> setItemCount(int itemCount)

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

Parameters:

itemCount: The item count for the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: TvContractCompat.PreviewProgramColumns.COLUMN_ITEM_COUNT

public BasePreviewProgram.Builder<T> setLive(boolean live)

Sets whether this TV program is live or not.

Parameters:

live: Whether the program is live or not.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: TvContractCompat.PreviewProgramColumns.COLUMN_LIVE

public BasePreviewProgram.Builder<T> setInteractionType(int interactionType)

Sets the type of interaction for this TV program.

The value should match one of the followings: .PreviewPrograms#INTERACTION_TYPE_LISTENS, .PreviewPrograms#INTERACTION_TYPE_FOLLOWERS, TvContractCompat.PreviewProgramColumns.INTERACTION_TYPE_FANS, TvContractCompat.PreviewProgramColumns.INTERACTION_TYPE_LIKES, .PreviewPrograms#INTERACTION_TYPE_THUMBS, TvContractCompat.PreviewProgramColumns.INTERACTION_TYPE_VIEWS, and .PreviewPrograms#INTERACTION_TYPE_VIEWERS.

Parameters:

interactionType: The interaction type of the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: TvContractCompat.PreviewProgramColumns.COLUMN_INTERACTION_TYPE

public BasePreviewProgram.Builder<T> setInteractionCount(long interactionCount)

Sets the interaction count for this program.

Parameters:

interactionCount: The interaction count for the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: TvContractCompat.PreviewProgramColumns.COLUMN_INTERACTION_COUNT

public BasePreviewProgram.Builder<T> setAuthor(java.lang.String author)

Sets the author or artist of this content.

Parameters:

author: The author of the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: TvContractCompat.PreviewProgramColumns.COLUMN_AUTHOR

public BasePreviewProgram.Builder<T> setBrowsable(boolean browsable)

Sets whether this TV program is browsable or not.

Parameters:

browsable: Whether the program is browsable or not.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: TvContractCompat.PreviewProgramColumns.COLUMN_BROWSABLE

public BasePreviewProgram.Builder<T> setContentId(java.lang.String contentId)

Sets the content ID for this program.

Parameters:

contentId: The content ID for the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: TvContractCompat.PreviewProgramColumns.COLUMN_CONTENT_ID

public BasePreviewProgram.Builder<T> setLogoContentDescription(java.lang.String logoContentDescription)

Sets the logo's content description for this program.

Parameters:

logoContentDescription: The content description for the logo displayed in the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: .PreviewPrograms#COLUMN_LOGO_CONTENT_DESCRIPTION, TvContractCompat.PreviewProgramColumns.COLUMN_LOGO_URI

public BasePreviewProgram.Builder<T> setGenre(java.lang.String genre)

Sets the genre for this program.

Parameters:

genre: The genre for the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: TvContractCompat.PreviewProgramColumns.COLUMN_GENRE

public BasePreviewProgram.Builder<T> setStartTimeUtcMillis(long startTime)

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

Parameters:

startTime: The start time for the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: .PreviewPrograms#COLUMN_START_TIME_UTC_MILLIS

public BasePreviewProgram.Builder<T> setEndTimeUtcMillis(long endTime)

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

Parameters:

endTime: The end time for the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: TvContractCompat.PreviewProgramColumns.COLUMN_END_TIME_UTC_MILLIS

public BasePreviewProgram.Builder<T> setPreviewAudioUri(Uri previewAudioUri)

Sets a URI for the preview audio.

Parameters:

previewAudioUri: The preview audio URI for the program.

Returns:

This Builder object to allow for chaining of calls to builder methods.

See also: TvContractCompat.PreviewProgramColumns.COLUMN_PREVIEW_AUDIO_URI

public BasePreviewProgram.Builder<T> setTvSeriesItemType(int type)

Set the TV series item type for this program.

Parameters:

type: the TV series item type

Returns:

This Builder object to allow for chaining of calls to builder methods.