Google 致力于为黑人社区推动种族平等。查看具体举措

AmbientController

class AmbientController
kotlin.Any
   ↳ androidx.wear.ambient.AmbientModeSupport.AmbientController

A class for interacting with the ambient mode on a wearable device. This class can be used to query the current state of ambient mode. An instance of this class is returned to the user when they attach their Activity to AmbientModeSupport.

Summary

Public methods
Boolean

Unit

Sets whether this activity is currently in a state that supports ambient offload mode.

Public methods

isAmbient

fun isAmbient(): Boolean
Return
Boolean true if the activity is currently in ambient.

setAmbientOffloadEnabled

fun setAmbientOffloadEnabled(enabled: Boolean): Unit

Sets whether this activity is currently in a state that supports ambient offload mode.