public final class PlatformDataKey<T extends DynamicBuilders.DynamicType> extends DynamicDataKey


Represent a DynamicDataKey that references real-time data from the platform.

The [namespace, key] tuple creates the actual reference, so that a single key can refer to two different sources in two different namespaces.

The namespace must not be empty. Additionally, the "protolayout" namespace (and its lowercase and uppercase variations) are reserved for the default platform data sources and should not be used for any custom OEM data source. To make sure namespaces are unique, any custom namespace is expected to follow Java style naming com.company.foo.

Parameters
<T extends DynamicBuilders.DynamicType>

The data type of the dynamic values that this key is bound to.

Summary

Public constructors

Create a PlatformDataKey with the specified key in the given namespace.

Inherited methods

From androidx.wear.protolayout.expression.DynamicDataKey
boolean
@NonNull String

Gets the key that references the dynamic data source

@NonNull String

Gets the namespace of the key for the dynamic data source.

int
@NonNull String

Public constructors

PlatformDataKey

Added in 1.0.0
public PlatformDataKey(@NonNull String namespace, @NonNull String key)

Create a PlatformDataKey with the specified key in the given namespace.

Parameters
@NonNull String namespace

The namespace of the key for the platform data source.

@NonNull String key

The key that references the platform data source.