Builder
class Builder
kotlin.Any | |
↳ | androidx.tvprovider.media.tv.PreviewChannel.Builder |
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 build()
method will throw an exception. The required fields are displayName and appLinkIntentUri; use the respective methods to set them.
Summary
Public constructors | |
---|---|
<init>() |
|
<init>(other: PreviewChannel!) |
Public methods | |
---|---|
PreviewChannel! |
build() Takes the values of the Builder object and creates a PreviewChannel object. |
PreviewChannel.Builder! |
setAppLinkIntent(appLinkIntent: Intent!) 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. |
PreviewChannel.Builder! |
setAppLinkIntentUri(appLinkIntentUri: Uri!) 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. |
PreviewChannel.Builder |
setDescription(@Nullable description: CharSequence?) It's good practice to include a general description of the programs in this channel. |
PreviewChannel.Builder! |
setDisplayName(displayName: CharSequence!) This is the name user sees when your channel appears on their TV home screen. |
PreviewChannel.Builder! |
setInternalProviderData(internalProviderData: ByteArray!) This is one of the optional fields that your app may set. |
PreviewChannel.Builder! |
setInternalProviderFlag1(flag: Long) This is one of the optional fields that your app may set. |
PreviewChannel.Builder! |
setInternalProviderFlag2(flag: Long) This is one of the optional fields that your app may set. |
PreviewChannel.Builder! |
setInternalProviderFlag3(flag: Long) This is one of the optional fields that your app may set. |
PreviewChannel.Builder! |
setInternalProviderFlag4(flag: Long) This is one of the optional fields that your app may set. |
PreviewChannel.Builder! |
setInternalProviderId(internalProviderId: String!) It is expected that your app or your server has its own internal representation (i.e. data structure) of channels. |
PreviewChannel.Builder! |
A logo visually identifies your channel. |
PreviewChannel.Builder! |
A logo visually identifies your channel. |
Public constructors
<init>
Builder()
<init>
Builder(other: PreviewChannel!)
Public methods
build
fun build(): PreviewChannel!
Takes the values of the Builder object and creates a PreviewChannel object.
Return | |
---|---|
PreviewChannel! |
PreviewChannel object with values from the Builder. |
setAppLinkIntent
fun setAppLinkIntent(appLinkIntent: Intent!): PreviewChannel.Builder!
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.
Return | |
---|---|
PreviewChannel.Builder! |
This Builder object to allow for chaining of calls to builder methods. |
setAppLinkIntentUri
fun setAppLinkIntentUri(appLinkIntentUri: Uri!): PreviewChannel.Builder!
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.
Return | |
---|---|
PreviewChannel.Builder! |
This Builder object to allow for chaining of calls to builder methods. |
setDescription
@NonNull fun setDescription(@Nullable description: CharSequence?): PreviewChannel.Builder
It's good practice to include a general description of the programs in this channel.
Return | |
---|---|
PreviewChannel.Builder |
This Builder object to allow for chaining of calls to builder methods. |
setDisplayName
fun setDisplayName(displayName: CharSequence!): PreviewChannel.Builder!
This is the name user sees when your channel appears on their TV home screen. For example "New Arrivals." This field is required.
Return | |
---|---|
PreviewChannel.Builder! |
This Builder object to allow for chaining of calls to builder methods. |
setInternalProviderData
fun setInternalProviderData(internalProviderData: ByteArray!): PreviewChannel.Builder!
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.
Return | |
---|---|
PreviewChannel.Builder! |
This Builder object to allow for chaining of calls to builder methods. |
setInternalProviderFlag1
fun setInternalProviderFlag1(flag: Long): PreviewChannel.Builder!
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.
Return | |
---|---|
PreviewChannel.Builder! |
This Builder object to allow for chaining of calls to builder methods. |
setInternalProviderFlag2
fun setInternalProviderFlag2(flag: Long): PreviewChannel.Builder!
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.
Return | |
---|---|
PreviewChannel.Builder! |
This Builder object to allow for chaining of calls to builder methods. |
setInternalProviderFlag3
fun setInternalProviderFlag3(flag: Long): PreviewChannel.Builder!
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.
Return | |
---|---|
PreviewChannel.Builder! |
This Builder object to allow for chaining of calls to builder methods. |
setInternalProviderFlag4
fun setInternalProviderFlag4(flag: Long): PreviewChannel.Builder!
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.
Return | |
---|---|
PreviewChannel.Builder! |
This Builder object to allow for chaining of calls to builder methods. |
setInternalProviderId
fun setInternalProviderId(internalProviderId: String!): PreviewChannel.Builder!
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. :
Return | |
---|---|
PreviewChannel.Builder! |
This Builder object to allow for chaining of calls to builder methods. |
setLogo
fun setLogo(@NonNull logoImage: Bitmap): PreviewChannel.Builder!
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.
Return | |
---|---|
PreviewChannel.Builder! |
This Builder object to allow for chaining of calls to builder methods. |
setLogo
fun setLogo(@NonNull logoUri: Uri): PreviewChannel.Builder!
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.
Return | |
---|---|
PreviewChannel.Builder! |
This Builder object to allow for chaining of calls to builder methods. |