java.lang.Object | |
↳ | android.support.app.recommendation.RecommendationExtender |
Helper class to add content info extensions to notifications. To create a notification with content info extensions:
Notification.Action.Builder
, setting any desired properties.
RecommendationExtender
.
add
and set
methods of
RecommendationExtender
.
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.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a
RecommendationExtender with default options.
| |||||||||||
Create a
RecommendationExtender from the RecommendationExtender options of an
existing Notification.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Apply content extensions to a notification that is being built.
| |||||||||||
Returns an array containing the content types that describe the content associated with the
notification.
| |||||||||||
Returns an array containing the content genres that describe the content associated with the
notification.
| |||||||||||
Returns the maturity level rating for the content associated with the notification.
| |||||||||||
Gets the pricing type for the content associated with the notification.
| |||||||||||
Gets the price value (when applicable) for the content associated with a notification.
| |||||||||||
Returns the primary content type tag for the content associated with the notification.
| |||||||||||
Returns the running time for the content associated with the notification.
| |||||||||||
Returns status value for the content associated with the notification.
| |||||||||||
Sets the content types associated with the notification content.
| |||||||||||
Sets the content genres associated with the notification content.
| |||||||||||
Sets the maturity level rating for the content associated with the notification.
| |||||||||||
Sets the pricing and availability information for the content associated with the
notification.
| |||||||||||
Sets the running time (when applicable) for the content associated with the notification.
| |||||||||||
Sets the availability status for the content associated with the notification.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
android.app.Notification.Extender
|
Create a RecommendationExtender
from the RecommendationExtender options of an
existing Notification.
notif | The notification from which to copy options. |
---|
Apply content extensions to a notification that is being built. This is typically called by
the Notification.Builder.extend(Notification.Extender)
method of Notification.Action.Builder
.
builder | the builder to be modified. |
---|
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.
CONTENT_TYPE_*
constants) that
describe the content associated with the notification.Returns an array containing the content genres that describe the content associated with the notification.
Returns the maturity level rating for the content associated with the notification.
CONTENT_MATURITY_*
constants).Gets the pricing type for the content associated with the notification.
CONTENT_PRICING_*
constants).Gets the price value (when applicable) for the content associated with a notification. The value will be provided as a String containing the price in the appropriate currency for the current locale.
Returns the primary content type tag for the content associated with the notification.
CONTENT_TYPE_*
constants) indicating the
primary type for the content associated with the notification.Returns the running time for the content associated with the notification.
Returns status value for the content associated with the notification. This status indicates whether the referred content is ready to be consumed on the device, or if the user must first purchase, rent, subscribe to, or download the content.
CONTENT_STATUS_*
for the defined valid status values).Sets the content types associated with the notification content. The first tag entry will be considered the primary type for the content and will be used for ranking purposes. Other secondary type tags may be provided, if applicable, and may be used for filtering purposes.
types | Array of predefined type tags (see the CONTENT_TYPE_* constants)
that describe the content referred to by a notification.
|
---|
Sets the content genres associated with the notification content. These genres may be used for content ranking. Genres are open ended String tags.
Some examples: "comedy", "action", "dance", "electronica", "racing", etc.
genres | Array of genre string tags that describe the content referred to by a notification. |
---|
Sets the maturity level rating for the content associated with the notification.
maturityRating | A tag indicating the maturity level rating for the content. This tag
must be one of the predefined maturity rating tags (see the CONTENT_MATURITY_*
constants).
|
---|
Sets the pricing and availability information for the content associated with the notification. The provided information will indicate the access model for the content (free, rental, purchase or subscription) and the price value (if not free).
priceType | Pricing type for this content. Must be one of the predefined pricing type
tags (see the CONTENT_PRICING_* constants). |
---|---|
priceValue | A string containing a representation of the content price in the current locale and currency. |
Sets the running time (when applicable) for the content associated with the notification.
length | The runing time, in seconds, of the content associated with the notification. |
---|
Sets the availability status for the content associated with the notification. This status indicates whether the referred content is ready to be consumed on the device, or if the user must first purchase, rent, subscribe to, or download the content.
contentStatus | The status value for this content. Must be one of the predefined content
status values (see the CONTENT_STATUS_* constants).
|
---|