PreviewChannel.Builder
public
static
final
class
PreviewChannel.Builder
extends Object
| java.lang.Object
|
| ↳ |
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
Inherited methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public constructors
Builder
public Builder ()
Public methods
build
public PreviewChannel build ()
Takes the values of the Builder object and creates a PreviewChannel object.
| Returns |
PreviewChannel |
PreviewChannel object with values from the Builder.
|
setAppLinkIntent
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.
| Parameters |
appLinkIntent |
Intent |
setAppLinkIntentUri
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.
| Parameters |
appLinkIntentUri |
Uri |
setDescription
public PreviewChannel.Builder setDescription (CharSequence description)
It's good practice to include a general description of the programs in this channel.
| Parameters |
description |
CharSequence |
setDisplayName
public PreviewChannel.Builder setDisplayName (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.
| Parameters |
displayName |
CharSequence |
setInternalProviderData
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.
| Parameters |
internalProviderData |
byte |
setInternalProviderFlag1
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.
setInternalProviderFlag2
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.
setInternalProviderFlag3
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.
setInternalProviderFlag4
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.
setInternalProviderId
public PreviewChannel.Builder setInternalProviderId (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.
:
| Parameters |
internalProviderId |
String |
setLogo
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.
| Parameters |
logoImage |
Bitmap |
setLogo
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.