AmbientOptions

public final class AmbientOptions
extends Object

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


AmbientOptions provide components a way to convey their specific ambient mode support configuration requirements for use with AmbientManager.createController(Context,AmbientOptions).

Options are specific to component type and components should use the creator methods provided to instantiate suitable base options.

Summary

Constants

int AMBIENT_SUPPORT_AUTORESUME_ONLY

Used with AmbientManager.Controller.setAmbientSupportLevel(int) indicating that this component does not provide an ambient-specific UI.

int AMBIENT_SUPPORT_NONE

Used with AmbientManager.Controller.setAmbientSupportLevel(int) indicates that the component does not support ambient mode at all.

int AMBIENT_SUPPORT_TAKEOVER_DISPLAY

Used with AmbientManager.Controller.setAmbientSupportLevel(int) indicating that this component implements full ambient mode support.

Public methods

boolean equals(Object o)

int hashCode()

static AmbientOptions makeActivityOptions(Activity activity, AmbientComponentState.ActivityStateRegistry stateRegistry, AmbientManager.AmbientComponentListener lifecycleListener, AmbientManager.AmbientTransitionListener transitionListener)

Make AmbientOptions suitable for use with an Activity based app component.

static AmbientOptions makeWatchFaceOptions(ComponentName component, AmbientComponentState.WatchFaceStateRegistry stateRegistry, AmbientManager.AmbientComponentListener lifecycleListener, AmbientManager.AmbientTransitionListener transitionListener)

Make AmbientOptions suitable for use with a watch face component.

String toString()

Inherited methods

Constants

AMBIENT_SUPPORT_AUTORESUME_ONLY

Added in version 33.1
public static final int AMBIENT_SUPPORT_AUTORESUME_ONLY

Used with AmbientManager.Controller.setAmbientSupportLevel(int) indicating that this component does not provide an ambient-specific UI. When entering ambient mode, this component will be moved to the background to make way for the system's ambient UI. However, if the system exits ambient mode early enough, this component will be automatically brought back to the foreground.

Constant Value: 1 (0x00000001)

AMBIENT_SUPPORT_NONE

Added in version 33.1
public static final int AMBIENT_SUPPORT_NONE

Used with AmbientManager.Controller.setAmbientSupportLevel(int) indicates that the component does not support ambient mode at all. When entering ambient mode, this component will be moved to the background to make way for the system's ambient UI.

Constant Value: 0 (0x00000000)

AMBIENT_SUPPORT_TAKEOVER_DISPLAY

Added in version 33.1
public static final int AMBIENT_SUPPORT_TAKEOVER_DISPLAY

Used with AmbientManager.Controller.setAmbientSupportLevel(int) indicating that this component implements full ambient mode support. That is, when entering ambient mode, this component will take over the display and provide a UI that is suitable for low power mode.

Constant Value: 2 (0x00000002)

Public methods

equals

Added in version 33.2
public boolean equals (Object o)

Parameters
o Object

Returns
boolean

hashCode

Added in version 33.2
public int hashCode ()

Returns
int

makeActivityOptions

Added in version 33.1
public static AmbientOptions makeActivityOptions (Activity activity, 
                AmbientComponentState.ActivityStateRegistry stateRegistry, 
                AmbientManager.AmbientComponentListener lifecycleListener, 
                AmbientManager.AmbientTransitionListener transitionListener)

Make AmbientOptions suitable for use with an Activity based app component.

Parameters
activity Activity: the Activity that will support Ambient.

stateRegistry AmbientComponentState.ActivityStateRegistry: the AmbientComponentState.ActivityStateRegistry that is used to track the app lifecycle so as to enable ambient support.

lifecycleListener AmbientManager.AmbientComponentListener: the AmbientManager.AmbientComponentListener implementation provided by the component that will be used to handle ambient state changes.

transitionListener AmbientManager.AmbientTransitionListener: the AmbientManager.AmbientComponentListener implementation provided by the component that will be used to handle visual transitions associated with ambient state changes.

Returns
AmbientOptions the options for use in registering the component via AmbientManager.createController(Context,AmbientOptions)

makeWatchFaceOptions

Added in version 33.1
public static AmbientOptions makeWatchFaceOptions (ComponentName component, 
                AmbientComponentState.WatchFaceStateRegistry stateRegistry, 
                AmbientManager.AmbientComponentListener lifecycleListener, 
                AmbientManager.AmbientTransitionListener transitionListener)

Make AmbientOptions suitable for use with a watch face component.

Parameters
component ComponentName: the ComponentName of the watch face.

stateRegistry AmbientComponentState.WatchFaceStateRegistry: the AmbientComponentState.WatchFaceStateRegistry that is used to track the watch face state so as to enable ambient support.

lifecycleListener AmbientManager.AmbientComponentListener: the AmbientManager.AmbientComponentListener implementation provided by the component that will be used to handle ambient state changes.

transitionListener AmbientManager.AmbientTransitionListener: the AmbientManager.AmbientTransitionListener implementation provided by the component that will be used to handle visual transitions associated with ambient state changes.

Returns
AmbientOptions the options for use in registering the component via AmbientManager.createController(Context,AmbientOptions)

toString

Added in version 33.1
public String toString ()

Returns
String