PreviewProgram

class PreviewProgram


A convenience class to access PreviewPrograms entries in the system content provider.

This class makes it easy to insert or retrieve a preview program from the system content provider, which is defined in TvContractCompat.

Usage example when inserting a preview program:

PreviewProgram previewProgram = new PreviewProgram.Builder()
        .setChannelId(channel.getId())
        .setType(PreviewPrograms.TYPE_MOVIE)
        .setTitle("Program Title")
        .setDescription("Program Description")
        .setPosterArtUri(Uri.parse("http://example.com/poster_art.png"))
        // Set more attributes...
        .build();
Uri previewProgramUri = getContentResolver().insert(PreviewPrograms.CONTENT_URI,
        previewProgram.toContentValues());

Usage example when retrieving a preview program:

PreviewProgram previewProgram;
try (Cursor cursor = resolver.query(previewProgramUri, null, null, null, null)) {
    if (cursor != null && cursor.getCount() != 0) {
        cursor.moveToNext();
        previewProgram = PreviewProgram.fromCursor(cursor);
    }
}

Usage example when updating an existing preview program:

PreviewProgram updatedProgram = new PreviewProgram.Builder(previewProgram)
        .setWeight(20)
        .build();
getContentResolver().update(TvContractCompat.buildPreviewProgramUri(updatedProgram.getId()),
        updatedProgram.toContentValues(), null, null);

Usage example when deleting a preview program:

getContentResolver().delete(TvContractCompat.buildPreviewProgramUri(existingProgram.getId()),
        null, null);

Summary

Nested types

This Builder class simplifies the creation of a PreviewProgram object.

Public functions

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

Creates a Program object from a cursor including the fields defined in PreviewPrograms.

Array<String!>!
String!
Int
Array<String!>!
Long
String!
Array<TvContentRating!>!
String!
Int
Long
String!
String!
String!
Long
Intent!
Uri!
Long
Int
ByteArray<Byte>!
Long!
Long!
Long!
Long!
String!
Int
Int
String!
Uri!
String!
String!
Int
Uri!
Uri!
Uri!
String!
String!
Int
String!
String!
String?
Long
String!
Int
Uri!
String!
Int
Int
Int
Int
Int
Boolean

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

Int
Boolean
Boolean
Boolean
Boolean
ContentValues!
String!

Public functions

equals

fun equals(other: Any!): Boolean

fromCursor

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

Creates a Program object from a cursor including the fields defined in PreviewPrograms.

Parameters
cursor: Cursor!

A row from the TV Input Framework database.

Returns
PreviewProgram!

A Program with the values taken from the cursor.

getAudioLanguages

Added in 1.1.0-alpha02
fun getAudioLanguages(): Array<String!>!
Returns
Array<String!>!

The audio languages for the program.

getAuthor

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

The author for the program.

See also
COLUMN_AUTHOR

getAvailability

Added in 1.1.0-alpha02
fun getAvailability(): Int
Returns
Int

The availability of the program.

getCanonicalGenres

Added in 1.1.0-alpha02
fun getCanonicalGenres(): Array<String!>!
Returns
Array<String!>!

The canonical genre for the program.

getChannelId

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

The value of COLUMN_CHANNEL_ID for the program.

getContentId

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

The content ID for the program.

getContentRatings

Added in 1.1.0-alpha02
fun getContentRatings(): Array<TvContentRating!>!
Returns
Array<TvContentRating!>!

The content rating for the program.

getDescription

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

The short description for the program.

getDurationMillis

Added in 1.1.0-alpha02
fun getDurationMillis(): Int
Returns
Int

The duration of the program in millis.

getEndTimeUtcMillis

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

The end time for the program.

getEpisodeNumber

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

The episode display number for the program.

getEpisodeTitle

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

The episode title for the program.

getGenre

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

The genre for the program.

See also
COLUMN_GENRE

getId

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

The ID for the program.

See also
_ID

getIntent

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

The intent which is launched when the program is selected.

getIntentUri

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

The intent URI which is launched when the program is selected.

getInteractionCount

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

The interaction count for the program.

getInteractionType

Added in 1.1.0-alpha02
fun getInteractionType(): Int
Returns
Int

The interaction type for the program.

getInternalProviderDataByteArray

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

The internal provider data for the program.

getInternalProviderFlag1

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

The first internal provider flag for the program.

getInternalProviderFlag2

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

The second internal provider flag for the program.

getInternalProviderFlag3

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

The third internal provider flag for the program.

getInternalProviderFlag4

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

The forth internal provider flag for the program.

getInternalProviderId

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

The internal provider ID for the program.

getItemCount

Added in 1.1.0-alpha02
fun getItemCount(): Int
Returns
Int

The item count for the program.

getLastPlaybackPositionMillis

Added in 1.1.0-alpha02
fun getLastPlaybackPositionMillis(): Int
Returns
Int

The last playback position of the program in millis.

See also
TvContractCompat

.PreviewPrograms#COLUMN_LAST_PLAYBACK_POSITION_MILLIS

getLogoContentDescription

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

The logo content description for the program.

See also
TvContractCompat

.PreviewPrograms#COLUMN_LOGO_CONTENT_DESCRIPTION

COLUMN_LOGO_URI

getLogoUri

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

The logo URI for the program.

See also
COLUMN_LOGO_URI

getLongDescription

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

The long description for the program.

getOfferPrice

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

The offer price of the program.

getPosterArtAspectRatio

Added in 1.1.0-alpha02
fun getPosterArtAspectRatio(): Int
Returns
Int

The poster art aspect ratio for the program.

getPosterArtUri

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

The poster art URI for the program.

getPreviewAudioUri

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

The preview audio URI for the program.

getPreviewVideoUri

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

The preview video URI for the program.

getReleaseDate

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

The release date of the program.

getReviewRating

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

The review rating for the program.

getReviewRatingStyle

Added in 1.1.0-alpha02
fun getReviewRatingStyle(): Int
Returns
Int

The review rating style for the program.

getSeasonNumber

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

The season display number for the program.

getSeasonTitle

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

The season title for the program.

getSeriesId

Added in 1.1.0-alpha02
fun getSeriesId(): String?
Returns
String?

The series ID for the program.

See also
COLUMN_SERIES_ID

getStartTimeUtcMillis

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

The start time for the program.

getStartingPrice

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

The starting price of the program.

getThumbnailAspectRatio

Added in 1.1.0-alpha02
fun getThumbnailAspectRatio(): Int
Returns
Int

The thumbnail aspect ratio for the program.

getThumbnailUri

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

The thumbnail URI for the program.

getTitle

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

The title for the program.

See also
COLUMN_TITLE

getTvSeriesItemType

Added in 1.1.0-alpha02
fun getTvSeriesItemType(): Int
Returns
Int

The TV series item type for the program.

getType

Added in 1.1.0-alpha02
fun getType(): Int
Returns
Int

The type of the program.

See also
COLUMN_TYPE

getVideoHeight

Added in 1.1.0-alpha02
fun getVideoHeight(): Int
Returns
Int

The video height for the program.

getVideoWidth

Added in 1.1.0-alpha02
fun getVideoWidth(): Int
Returns
Int

The video width for the program.

getWeight

Added in 1.1.0-alpha02
fun getWeight(): Int
Returns
Int

The value of COLUMN_WEIGHT for the program.

hasAnyUpdatedValues

Added in 1.1.0-alpha02
fun hasAnyUpdatedValues(update: PreviewProgram!): Boolean

Indicates whether some other PreviewProgram has any set attribute that is different from this PreviewProgram'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

Whether the program is browsable or not.

See also
COLUMN_BROWSABLE

isLive

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

Whether the program is live or not.

See also
COLUMN_LIVE

isSearchable

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

Whether the program is searchable or not.

isTransient

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

Whether the program is transient or not.

See also
COLUMN_TRANSIENT

toContentValues

Added in 1.1.0-alpha02
fun toContentValues(): ContentValues!
Returns
ContentValues!

The fields of the Program in the ContentValues format to be easily inserted into the TV Input Framework database.

toString

fun toString(): String!