Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

AmbientCallback

abstract class AmbientCallback
kotlin.Any
   ↳ androidx.wear.ambient.AmbientModeSupport.AmbientCallback

Callback to receive ambient mode state changes. It must be used by all users of AmbientMode.

Summary

Public constructors

Callback to receive ambient mode state changes.

Public methods
open Unit

Called to inform an activity that whatever decomposition it has sent to Sidekick is no longer valid and should be re-sent before enabling ambient offload.

open Unit

Called when an activity should exit ambient mode.

open Unit

Called when the system is updating the display for ambient mode.

open Unit
onEnterAmbient(ambientDetails: Bundle!)

Called when an activity is entering ambient mode.

Public constructors

<init>

AmbientCallback()

Callback to receive ambient mode state changes. It must be used by all users of AmbientMode.

Public methods

onAmbientOffloadInvalidated

open fun onAmbientOffloadInvalidated(): Unit

Called to inform an activity that whatever decomposition it has sent to Sidekick is no longer valid and should be re-sent before enabling ambient offload.

onExitAmbient

open fun onExitAmbient(): Unit

Called when an activity should exit ambient mode. This event is sent while an activity is running (after onResume, before onPause).

onUpdateAmbient

open fun onUpdateAmbient(): Unit

Called when the system is updating the display for ambient mode. Activities may use this opportunity to update or invalidate views.

onEnterAmbient

open fun onEnterAmbient(ambientDetails: Bundle!): Unit

Called when an activity is entering ambient mode. This event is sent while an activity is running (after onResume, before onPause). All drawing should complete by the conclusion of this method. Note that invalidate() calls will be executed before resuming lower-power mode.

Parameters
ambientDetails Bundle!: bundle containing information about the display being used. It includes information about low-bit color and burn-in protection.