PreviewChannel


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.

Summary

Nested types

This builder makes it easy to create a PreviewChannel object by allowing you to chain setters.

Public functions

Boolean
equals(other: Any!)
java-static PreviewChannel!
fromCursor(cursor: Cursor!)

Used by PreviewChannelHelper to transduce a TvProvider channel row into a PreviewChannel Java object.

Intent!
Uri!
CharSequence!
CharSequence!
Long
ByteArray<Byte>!
Long!
Long!
Long!
Long!
String!
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.

String!
String!
Boolean

Indicates whether some other PreviewChannel has any set attribute that is different from this PreviewChannel's respective attributes.

Int
Boolean
String!

Public functions

equals

fun equals(other: Any!): Boolean

fromCursor

Added in 1.1.0-alpha02
java-static fun fromCursor(cursor: Cursor!): PreviewChannel!

Used by 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 .PreviewChannel.Columns#PROJECTION. This way, all indices are known beforehand.
Parameters
cursor: Cursor!

a cursor row from the TvProvider

Returns
PreviewChannel!

a PreviewChannel whose values come from the cursor row

getAppLinkIntent

Added in 1.1.0-alpha02
fun getAppLinkIntent(): Intent!
Returns
Intent!

The value of COLUMN_APP_LINK_INTENT_URI for the program.

getAppLinkIntentUri

Added in 1.1.0-alpha02
fun getAppLinkIntentUri(): Uri!
Returns
Uri!

The value of COLUMN_APP_LINK_INTENT_URI for the channel.

getDescription

Added in 1.1.0-alpha02
fun getDescription(): CharSequence!
Returns
CharSequence!

The value of COLUMN_DESCRIPTION for the channel. A short text explaining what this channel contains.

getDisplayName

Added in 1.1.0-alpha02
fun getDisplayName(): CharSequence!
Returns
CharSequence!

The name users see when this channel appears on the home screen

getId

Added in 1.1.0-alpha02
fun getId(): Long
Returns
Long

the ID the system assigns to this preview channel upon publication.

getInternalProviderDataByteArray

Added in 1.1.0-alpha02
fun getInternalProviderDataByteArray(): ByteArray<Byte>!
Returns
ByteArray<Byte>!

The value of COLUMN_INTERNAL_PROVIDER_DATA for the channel.

getInternalProviderFlag1

Added in 1.1.0-alpha02
fun getInternalProviderFlag1(): Long!
Returns
Long!

The value of COLUMN_INTERNAL_PROVIDER_FLAG1 for the channel.

getInternalProviderFlag2

Added in 1.1.0-alpha02
fun getInternalProviderFlag2(): Long!
Returns
Long!

The value of COLUMN_INTERNAL_PROVIDER_FLAG2 for the channel.

getInternalProviderFlag3

Added in 1.1.0-alpha02
fun getInternalProviderFlag3(): Long!
Returns
Long!

The value of COLUMN_INTERNAL_PROVIDER_FLAG3 for the channel.

getInternalProviderFlag4

Added in 1.1.0-alpha02
fun getInternalProviderFlag4(): Long!
Returns
Long!

The value of COLUMN_INTERNAL_PROVIDER_FLAG4 for the channel.

getInternalProviderId

Added in 1.1.0-alpha02
fun getInternalProviderId(): String!
Returns
String!

The value of COLUMN_INTERNAL_PROVIDER_ID for the channel.

getLogo

Added in 1.1.0-alpha02
@WorkerThread
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.

Returns
Bitmap!

The logo associated with this preview channel

getPackageName

Added in 1.1.0-alpha02
fun getPackageName(): String!
Returns
String!

package name of the app that created this channel

getType

Added in 1.1.0-alpha02
fun getType(): String!
Returns
String!

what type of channel this is. For preview channels, the type is always TvContractCompat.Channels.TYPE_PREVIEW

hasAnyUpdatedValues

Added in 1.1.0-alpha02
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.

hashCode

fun hashCode(): Int

isBrowsable

Added in 1.1.0-alpha02
fun isBrowsable(): Boolean
Returns
Boolean

The value of COLUMN_BROWSABLE for the channel. A preview channel is BROWABLE when it is visible on the TV home screen.

toString

fun toString(): String!