AmbientComponentState

public class AmbientComponentState
extends Object

java.lang.Object
   ↳ com.google.wear.services.ambient.AmbientComponentState


This lends lifecycle-awareness to ambient components. Apps and watch faces that wish to implement support for ambient mode can use the respective/provided state registries to communicate their state to the AmbientManager for use in evaluating the appropriate display during ambient mode.

Summary

Nested classes

class AmbientComponentState.ActivityStateRegistry

A state registry specifically intended for app components that subscribe to the standard Android lifecycle. 

class AmbientComponentState.WatchFaceStateRegistry

A state registry specifically intended for watch face components based on the wallpaper visibility. 

Public methods

static AmbientComponentState.ActivityStateRegistry makeActivityStateRegistry()

A convenience method to create an ActivityStateRegistry for use with the AmbientManager.

static AmbientComponentState.WatchFaceStateRegistry makeWatchFaceStateRegistry()

A convenience method to create an WatchFaceStateRegistry for use with the AmbientManager.

Inherited methods

Public methods

makeActivityStateRegistry

Added in version 33.1
public static AmbientComponentState.ActivityStateRegistry makeActivityStateRegistry ()

A convenience method to create an ActivityStateRegistry for use with the AmbientManager. This registry is specifically designed to support to app components as it is based on the standard Android Activity lifecycle.

Returns
AmbientComponentState.ActivityStateRegistry an ActivityStateRegistry suitable for app components to use when registering with AmbientManager.

makeWatchFaceStateRegistry

Added in version 33.1
public static AmbientComponentState.WatchFaceStateRegistry makeWatchFaceStateRegistry ()

A convenience method to create an WatchFaceStateRegistry for use with the AmbientManager. This registry is specifically intended to support watch face components as it is based on wallpaper visibility as opposed to a specific application lifecycle.

Returns
AmbientComponentState.WatchFaceStateRegistry an WatchFaceStateRegistry suitable for app components to use when registering with AmbientManager.