PreviewChannel
public
class
PreviewChannel
extends Object
java.lang.Object
|
↳ |
androidx.tvprovider.media.tv.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 PreviewChannel.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 classes |
class |
PreviewChannel.Builder
This builder makes it easy to create a PreviewChannel object by allowing you to chain
setters.
|
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 methods
equals
public boolean equals (Object other)
fromCursor
public static PreviewChannel fromCursor (Cursor cursor)
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
public Intent getAppLinkIntent ()
Throws |
URISyntaxException |
|
getAppLinkIntentUri
public Uri getAppLinkIntentUri ()
getDescription
public CharSequence getDescription ()
getDisplayName
public CharSequence getDisplayName ()
Returns |
CharSequence |
The name users see when this channel appears on the home screen
|
getId
public long getId ()
Returns |
long |
the ID the system assigns to this preview channel upon publication.
|
getInternalProviderDataByteArray
public byte[] getInternalProviderDataByteArray ()
getInternalProviderFlag1
public Long getInternalProviderFlag1 ()
getInternalProviderFlag2
public Long getInternalProviderFlag2 ()
getInternalProviderFlag3
public Long getInternalProviderFlag3 ()
getInternalProviderFlag4
public Long getInternalProviderFlag4 ()
getInternalProviderId
public String getInternalProviderId ()
getLogo
public Bitmap getLogo (Context context)
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.
Parameters |
context |
Context |
Returns |
Bitmap |
The logo associated with this preview channel
|
getPackageName
public String getPackageName ()
Returns |
String |
package name of the app that created this channel
|
getType
public String getType ()
Returns |
String |
what type of channel this is. For preview channels, the type is always
TvContractCompat.Channels.TYPE_PREVIEW
|
public boolean hasAnyUpdatedValues (PreviewChannel update)
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.
Parameters |
update |
PreviewChannel |
hashCode
public int hashCode ()
isBrowsable
public boolean isBrowsable ()
toString
public String toString ()
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples/Code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-02-24 UTC.