WearDataLayerRegistry

class WearDataLayerRegistry(val dataClient: DataClient, val nodeClient: NodeClient, val messageClient: MessageClient, val capabilityClient: CapabilityClient, coroutineScope: CoroutineScope)

Implementation of Androidx Datastore for Proto and Preferences on top of the Wearable DataClient.

See https://developer.android.com/topic/libraries/architecture/datastore for DataStore features.

Constructors

Link copied to clipboard
constructor(dataClient: DataClient, nodeClient: NodeClient, messageClient: MessageClient, capabilityClient: CapabilityClient, coroutineScope: CoroutineScope)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val capabilityClient: CapabilityClient
Link copied to clipboard
val dataClient: DataClient
Link copied to clipboard
val messageClient: MessageClient
Link copied to clipboard
val nodeClient: NodeClient
Link copied to clipboard

Functions

Link copied to clipboard
fun onDataChanged(dataEvents: List<DataEvent>)
Link copied to clipboard
fun <T> protoDataStore(path: String, coroutineScope: CoroutineScope, serializer: Serializer<T>, started: SharingStarted = SharingStarted.WhileSubscribed(5000)): DataStore<T>

Returns a local Proto DataStore for the given Proto structure.

Link copied to clipboard
inline fun <T : Any> WearDataLayerRegistry.protoDataStore(coroutineScope: CoroutineScope): DataStore<T>
Link copied to clipboard
fun <T> protoFlow(targetNodeId: TargetNodeId, serializer: Serializer<T>, path: String): Flow<T>
Link copied to clipboard
inline fun <T : Any> WearDataLayerRegistry.protoFlow(node: TargetNodeId): Flow<T>
Link copied to clipboard
inline fun <T : Any> registerProtoDataListener(path: String, listener: ProtoDataListener<T>)
fun <T : Any> registerProtoDataListener(path: String, listener: ProtoDataListener<T>, serializer: Serializer<T>)
Link copied to clipboard
inline fun <T : Any> registerSerializer(serializer: Serializer<T>)