added in version 24.1.0
belongs to Maven artifact com.android.support:recommendation:28.0.0-alpha1

RecommendationExtender

public final class RecommendationExtender
extends Object implements Notification.Extender

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:

  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

From class java.lang.Object