RecommendationExtender

public final class RecommendationExtender
extends Object implements Notification.Extender

java.lang.Object
   ↳ androidx.recommendation.app.RecommendationExtender


Helper class to add content info extensions to notifications. To create a notification with content info extensions:

  1. Create an Notification.CarExtender.Builder, setting any desired properties.
  2. Create a RecommendationExtender.
  3. Set content info specific properties using the add and set methods of RecommendationExtender.
  4. 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

RecommendationExtender()

Create a RecommendationExtender with default options.

RecommendationExtender(Notification notif)

Create a RecommendationExtender from the RecommendationExtender options of an existing Notification.

Public methods

Notification.Builder extend(Notification.Builder builder)

Apply content extensions to a notification that is being built.

String[] getContentTypes()

Returns an array containing the content types that describe the content associated with the notification.

String[] getGenres()

Returns an array containing the content genres that describe the content associated with the notification.

String getMaturityRating()

Returns the maturity level rating for the content associated with the notification.

String getPricingType()

Gets the pricing type for the content associated with the notification.

String getPricingValue()

Gets the price value (when applicable) for the content associated with a notification.

String getPrimaryContentType()

Returns the primary content type tag for the content associated with the notification.

long getRunningTime()

Returns the running time for the content associated with the notification.

int getStatus()

Returns status value for the content associated with the notification.

RecommendationExtender setContentTypes(String[] types)

Sets the content types associated with the notification content.

RecommendationExtender setGenres(String[] genres)

Sets the content genres associated with the notification content.

RecommendationExtender setMaturityRating(String maturityRating)

Sets the maturity level rating for the content associated with the notification.

RecommendationExtender setPricingInformation(String priceType, String priceValue)

Sets the pricing and availability information for the content associated with the notification.

RecommendationExtender setRunningTime(long length)

Sets the running time (when applicable) for the content associated with the notification.

RecommendationExtender setStatus(int contentStatus)

Sets the availability status for the content associated with the notification.

Inherited methods

Public constructors

RecommendationExtender

public RecommendationExtender ()

Create a RecommendationExtender with default options.

RecommendationExtender

public RecommendationExtender (Notification notif)

Create a RecommendationExtender from the RecommendationExtender options of an existing Notification.

Parameters
notif Notification: The notification from which to copy options.

Public methods

extend

public Notification.Builder extend (Notification.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.CarExtender.Builder.

Parameters
builder Notification.Builder

Returns
Notification.Builder

getContentTypes

public String[] getContentTypes ()

R