DynamicTypeEvaluator.Config.Builder


class DynamicTypeEvaluator.Config.Builder


Builds a DynamicTypeEvaluator.Config.

Summary

Public constructors

Public functions

DynamicTypeEvaluator.Config.Builder
addPlatformDataProvider(
    platformDataProvider: PlatformDataProvider,
    supportedDataKeys: (Mutable)Set<PlatformDataKey<Any!>!>
)

Add a platform data provider and specify the keys it can provide dynamic data for.

DynamicTypeEvaluator.Config
DynamicTypeEvaluator.Config.Builder

Sets the quota manager used for limiting the number of concurrently running animations.

DynamicTypeEvaluator.Config.Builder

Sets the clock (Instant supplier) used for providing time data to bindings.

DynamicTypeEvaluator.Config.Builder

Sets the quota manager used for limiting the total size of dynamic types in the pipeline.

DynamicTypeEvaluator.Config.Builder

Sets the notifier used for updating the platform time data.

DynamicTypeEvaluator.Config.Builder

Sets the state store that will be used for dereferencing the state keys in the dynamic types.

Public constructors

Builder

Added in 1.0.0
Builder()

Public functions

addPlatformDataProvider

Added in 1.0.0
fun addPlatformDataProvider(
    platformDataProvider: PlatformDataProvider,
    supportedDataKeys: (Mutable)Set<PlatformDataKey<Any!>!>
): DynamicTypeEvaluator.Config.Builder

Add a platform data provider and specify the keys it can provide dynamic data for.

The provider must support at least one key. If the provider supports multiple keys, they should not be independent, as their values should always update together. One data key must not have multiple providers, or an exception will be thrown.

Throws
java.lang.IllegalArgumentException

If a PlatformDataProvider supports an empty key set or if a key has multiple data providers.

build

Added in 1.0.0
fun build(): DynamicTypeEvaluator.Config

setAnimationQuotaManager

Added in 1.0.0
fun setAnimationQuotaManager(value: QuotaManager): DynamicTypeEvaluator.Config.Builder

Sets the quota manager used for limiting the number of concurrently running animations.

If not set, animations are disabled and non-infinite animations will have the end value immediately.

setClock

Added in 1.0.0
@VisibleForTesting
fun setClock(clock: Supplier<Instant!>): DynamicTypeEvaluator.Config.Builder

Sets the clock (Instant supplier) used for providing time data to bindings. If not set, on every reevaluation, platform time for dynamic values will be set to now.

setDynamicTypesQuotaManager

Added in 1.0.0
fun setDynamicTypesQuotaManager(value: QuotaManager): DynamicTypeEvaluator.Config.Builder

Sets the quota manager used for limiting the total size of dynamic types in the pipeline.

If not set, number of dynamic types will not be restricted.

setPlatformTimeUpdateNotifier

Added in 1.0.0
fun setPlatformTimeUpdateNotifier(notifier: PlatformTimeUpdateNotifier): DynamicTypeEvaluator.Config.Builder

Sets the notifier used for updating the platform time data. If not set, by default platform time will be updated at 1Hz using a Handler on the main thread.

setStateStore

Added in 1.0.0
fun setStateStore(value: StateStore): DynamicTypeEvaluator.Config.Builder

Sets the state store that will be used for dereferencing the state keys in the dynamic types.

If not set, it's the equivalent of setting an empty state store (state bindings will trigger onInvalidated).