PolicyProvider

@IviExperimental(reasons = [])
data class PolicyProvider(val compareItemsPolicy: MediaItemComparisonPolicy = DefaultMediaItemComparisonPolicy(), val itemMappingPolicy: MediaItemMappingPolicy = DefaultMediaItemMappingPolicy(), val sourceAttributionPolicy: MediaSourceAttributionPolicy = DefaultMediaSourceAttributionPolicy(), val mediaControlPolicy: MediaControlPolicy = DefaultMediaControlPolicy(), val collectionPolicy: CollectionPolicy = DefaultCollectionPolicy(), val userFlowPolicy: UserFlowPolicy = UserFlowPolicy(), val sourceDefinitionPolicy: SourceDefinitionPolicy = DefaultSourceDefinitionPolicy())

A container of customization policies for a media source.

Each customization policy is a short algorithm to perform a specific action that may be different across media sources.

All of the fields are optional and can be left to their default values, which will then use the policy used by the stock fallbackMediaPolicyFrontendExtension.

Examples: All example apps can be found in the Android Studio project inside the TomTom Digital Cockpit SDK.

  • How to add custom policies for a media source: examples/media/custompolicies/

  • How to change the fallback media policy: examples/media/fallbackpolicy/

  • How to customize the media source browsing user flow to show a custom panel: examples/media/userflowpolicy/

Parameters

compareItemsPolicy

A policy to compare two media items.

itemMappingPolicy

A policy to modify data in media items before displaying them.

sourceAttributionPolicy

A policy to customize source attributions, such as logos.

mediaControlPolicy

The policy that configures the available media controls.

collectionPolicy

The policy that determines if the media item represents a collection and allows managing actions on a collection.

userFlowPolicy

A policy to customize a source's user flows, such as logging in, browsing a source and accessing settings.

sourceDefinitionPolicy

A policy to define some general traits of a source.

Constructors

Link copied to clipboard
constructor(compareItemsPolicy: MediaItemComparisonPolicy = DefaultMediaItemComparisonPolicy(), itemMappingPolicy: MediaItemMappingPolicy = DefaultMediaItemMappingPolicy(), sourceAttributionPolicy: MediaSourceAttributionPolicy = DefaultMediaSourceAttributionPolicy(), mediaControlPolicy: MediaControlPolicy = DefaultMediaControlPolicy(), collectionPolicy: CollectionPolicy = DefaultCollectionPolicy(), userFlowPolicy: UserFlowPolicy = UserFlowPolicy(), sourceDefinitionPolicy: SourceDefinitionPolicy = DefaultSourceDefinitionPolicy())