RecommendationExtender
class RecommendationExtender : Extender
kotlin.Any | |
↳ | androidx.recommendation.app.RecommendationExtender |
Helper class to add content info extensions to notifications. To create a notification with content info extensions:
- Create an
Notification.Builder
, setting any desired properties. - Create a
RecommendationExtender
. - Set content info specific properties using the
add
andset
methods ofRecommendationExtender
. - Call
Notification.Builder.extend(Notification.Extender)
to apply the extensions to a notification.
Notification notification = new Notification.Builder(context) * ... * .extend(new RecommendationExtender() * .set*(...)) * .build(); *
Content info extensions can be accessed on an existing notification by using the RecommendationExtender(Notification)
constructor, and then using the get
methods to access values.
Summary
Public constructors | |
---|---|
<init>() Create a |
|
<init>(notif: Notification!) Create a |
Public methods | |
---|---|
Builder! |
Apply content extensions to a notification that is being built. |
Array<String!>! |
Returns an array containing the content types that describe the content associated with the notification. |
Array<String!>! |
Returns an array containing the content genres that describe the content associated with the notification. |
String! |
Returns the maturity level rating for the content associated with the notification. |
String! |
Gets the pricing type for the content associated with the notification. |
String! |
Gets the price value (when applicable) for the content associated with a notification. |
String! |
Returns the primary content type tag for the content associated with the notification. |
Long |
Returns the running time for the content associated with the notification. |
Int |
Returns status value for the content associated with the notification. |
RecommendationExtender! |
setContentTypes(types: Array<String!>!) Sets the content types associated with the notification content. |
RecommendationExtender! |
Sets the content genres associated with the notification content. |
RecommendationExtender! |
setMaturityRating(maturityRating: String!) Sets the maturity level rating for the content associated with the notification. |
RecommendationExtender! |
setPricingInformation(priceType: String!, priceValue: String!) Sets the pricing and availability information for the content associated with the notification. |
RecommendationExtender! |
setRunningTime(length: Long) Sets the running time (when applicable) for the content associated with the notification. |
RecommendationExtender! |
Sets the availability status for the content associated with the notification. |
Public constructors
<init>
RecommendationExtender(notif: Notification!)
Create a RecommendationExtender
from the RecommendationExtender options of an existing Notification.
Parameters | |
---|---|
notif |
Notification!: The notification from which to copy options. |
Public methods
extend
fun extend(builder: Builder!): Builder!
Apply content extensions to a notification that is being built. This is typically called by the Notification.Builder.extend(Notification.Extender)
method of Notification.Builder
.
getContentTypes
fun getContentTypes(): Array<String!>!
Returns an array containing the content types that describe the content associated with the notification. The first tag entry is considered the primary type for the content, and is used for content ranking purposes.
Return | |
---|---|
Array<String!>! |
An array of predefined type tags (see the CONTENT_TYPE_* constants) that describe the content associated with the notification. |
getGenres
fun getGenres(): Array<String!>!
Returns an array containing the content genres that describe the content associated with the notification.
Return | |
---|---|
Array<String!>! |
An array of genre tags that describe the content associated with the notification. |
See Also
getMaturityRating
fun getMaturityRating(): String!
Returns the maturity level rating for the content associated with the notification.
Return | |
---|---|
String! |
returns a predefined tag indicating the maturity level rating for the content (see the CONTENT_MATURITY_* constants). |