public final class

PreviewChannel.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.tvprovider.media.tv.PreviewChannel.Builder

Overview

This builder makes it easy to create a PreviewChannel object by allowing you to chain setters. Even though this builder provides a no-arg constructor, certain fields are required or the PreviewChannel.Builder.build() method will throw an exception. The required fields are displayName and appLinkIntentUri; use the respective methods to set them.

Summary

Constructors
publicBuilder()

publicBuilder(PreviewChannel other)

Methods
public PreviewChannelbuild()

Takes the values of the Builder object and creates a PreviewChannel object.

public PreviewChannel.BuildersetAppLinkIntent(Intent appLinkIntent)

When user clicks on this channel's logo, the system will send an Intent for your app to open an Activity with contents relevant to this channel.

public PreviewChannel.BuildersetAppLinkIntentUri(Uri appLinkIntentUri)

When user clicks on this channel's logo, the system will send an Intent for your app to open an Activity with contents relevant to this channel.

public PreviewChannel.BuildersetDescription(java.lang.CharSequence description)

It's good practice to include a general description of the programs in this channel.

public PreviewChannel.BuildersetDisplayName(java.lang.CharSequence displayName)

This is the name user sees when your channel appears on their TV home screen.

public PreviewChannel.BuildersetInternalProviderData(byte[] internalProviderData[])

This is one of the optional fields that your app may set.

public PreviewChannel.BuildersetInternalProviderFlag1(long flag)

This is one of the optional fields that your app may set.

public PreviewChannel.BuildersetInternalProviderFlag2(long flag)

This is one of the optional fields that your app may set.

public PreviewChannel.BuildersetInternalProviderFlag3(long flag)

This is one of the optional fields that your app may set.

public PreviewChannel.BuildersetInternalProviderFlag4(long flag)

This is one of the optional fields that your app may set.

public PreviewChannel.BuildersetInternalProviderId(java.lang.String internalProviderId)

It is expected that your app or your server has its own internal representation (i.e.

public PreviewChannel.BuildersetLogo(Bitmap logoImage)

A logo visually identifies your channel.

public PreviewChannel.BuildersetLogo(Uri logoUri)

A logo visually identifies your channel.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

public Builder(PreviewChannel other)

Methods

public PreviewChannel.Builder setDisplayName(java.lang.CharSequence displayName)

This is the name user sees when your channel appears on their TV home screen. For example "New Arrivals." This field is required.

Returns:

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

See also: TvContractCompat.Channels.COLUMN_DISPLAY_NAME

public PreviewChannel.Builder setDescription(java.lang.CharSequence description)

It's good practice to include a general description of the programs in this channel.

Returns:

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

See also: TvContractCompat.Channels.COLUMN_DESCRIPTION

public PreviewChannel.Builder setAppLinkIntent(Intent appLinkIntent)

When user clicks on this channel's logo, the system will send an Intent for your app to open an Activity with contents relevant to this channel. Hence, the Intent data you provide here must point to content relevant to this channel.

Returns:

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

public PreviewChannel.Builder setAppLinkIntentUri(Uri appLinkIntentUri)

When user clicks on this channel's logo, the system will send an Intent for your app to open an Activity with contents relevant to this channel. Hence, the Uri you provide here must point to content relevant to this channel.

Returns:

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

See also: TvContractCompat.Channels.COLUMN_APP_LINK_INTENT_URI

public PreviewChannel.Builder setInternalProviderId(java.lang.String internalProviderId)

It is expected that your app or your server has its own internal representation (i.e. data structure) of channels. It is highly recommended that you store your app/server's channel ID here; so that you may easily relate this published preview channel with the corresponding channel from your server. The publish method check this field to verify whether a preview channel being published would result in a duplicate. :

Returns:

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

See also: TvContractCompat.Channels.COLUMN_INTERNAL_PROVIDER_ID

public PreviewChannel.Builder setInternalProviderData(byte[] internalProviderData[])

This is one of the optional fields that your app may set. Use these fields at your discretion to help you remember important information about this channel. For example, if this channel needs a byte array that is expensive for your app to construct, you may choose to save it here.

Returns:

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

See also: TvContractCompat.Channels.COLUMN_INTERNAL_PROVIDER_DATA

public PreviewChannel.Builder setInternalProviderFlag1(long flag)

This is one of the optional fields that your app may set. Use these fields at your discretion to help you remember important information about this channel. For example, you may use this flag to track additional data about this particular channel.

Returns:

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

See also: TvContractCompat.Channels.COLUMN_INTERNAL_PROVIDER_FLAG1

public PreviewChannel.Builder setInternalProviderFlag2(long flag)

This is one of the optional fields that your app may set. Use these fields at your discretion to help you remember important information about this channel. For example, you may use this flag to track additional data about this particular channel.

Returns:

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

See also: TvContractCompat.Channels.COLUMN_INTERNAL_PROVIDER_FLAG2

public PreviewChannel.Builder setInternalProviderFlag3(long flag)

This is one of the optional fields that your app may set. Use these fields at your discretion to help you remember important information about this channel. For example, you may use this flag to track additional data about this particular channel.

Returns:

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

See also: TvContractCompat.Channels.COLUMN_INTERNAL_PROVIDER_FLAG3

public PreviewChannel.Builder setInternalProviderFlag4(long flag)

This is one of the optional fields that your app may set. Use these fields at your discretion to help you remember important information about this channel. For example, you may use this flag to track additional data about this particular channel.

Returns:

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

See also: TvContractCompat.Channels.COLUMN_INTERNAL_PROVIDER_FLAG4

public PreviewChannel.Builder setLogo(Bitmap logoImage)

A logo visually identifies your channel. Hence, you should consider adding a unique logo to every channel you create, so user can quickly identify your channel.

Returns:

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

public PreviewChannel.Builder setLogo(Uri logoUri)

A logo visually identifies your channel. Hence, you should consider adding a unique logo to every channel you create, so user can quickly identify your channel.

Returns:

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

public PreviewChannel build()

Takes the values of the Builder object and creates a PreviewChannel object.

Returns:

PreviewChannel object with values from the Builder.