open class PreviewChannel
Since API 26, all TV apps may create preview channels and publish them to the home screen. We call these App Channels (as distinct from the Live Channels row on the home screen). To help you create App Channels, the support library provides a number of classes prefixed by the word Preview-. This is a convenience class for mapping your app's content into a
TvProvider Channel for publication. Use the provided
Builder for creating your preview channel object. Once you create a preview channel, you can use
PreviewChannelHelper to publish it and add
programs to it.
This builder makes it easy to create a PreviewChannel object by allowing you to chain setters.
open fun getInternalProviderFlag4(): Long!
open fun getInternalProviderFlag3(): Long!
open fun hashCode(): Int
open fun getInternalProviderFlag2(): Long!
open fun getInternalProviderFlag1(): Long!
open fun toString(): String
open fun getId(): Long
|Long: the ID the system assigns to this preview channel upon publication.
open fun getType(): String!
|String!: what type of channel this is. For preview channels, the type is always TvContractCompat.Channels.TYPE_PREVIEW
open fun getDisplayName(): CharSequence!
|CharSequence!: The name users see when this channel appears on the home screen
open fun getAppLinkIntentUri(): Uri!
open fun getInternalProviderDataByteArray(): ByteArray!
open fun hasAnyUpdatedValues(update: PreviewChannel!): Boolean
Indicates whether some other PreviewChannel has any set attribute that is different from this PreviewChannel's respective attributes. An attribute is considered "set" if its key is present in the ContentValues vector.
open fun getInternalProviderId(): String!
open fun isBrowsable(): Boolean
open fun getAppLinkIntent(): Intent!
@WorkerThread open fun getLogo(context: Context!): Bitmap!
This method should be called on a worker thread since decoding Bitmap is an expensive operation and therefore should not be performed on the main thread.
|Bitmap!: The logo associated with this preview channel
open fun getPackageName(): String!
|String!: package name of the app that created this channel
open static fun fromCursor(cursor: Cursor!): PreviewChannel!
PreviewChannelHelper to transduce a TvProvider channel row into a PreviewChannel Java object. You never need to use this method unless you want to convert database rows to PreviewChannel objects yourself.
This method assumes the cursor was obtained using
. This way, all indices are known beforehand.
|Cursor!: a cursor row from the TvProvider
|PreviewChannel!: a PreviewChannel whose values come from the cursor row