O Google tem o compromisso de promover a igualdade racial para as comunidades negras. Saiba como.

AmbientModeSupport

class AmbientModeSupport : Fragment
kotlin.Any
   ↳ androidx.fragment.app.Fragment
   ↳ androidx.wear.ambient.AmbientModeSupport

Use this as a headless Fragment to add ambient support to an Activity on Wearable devices.

The application that uses this should add the android.Manifest.permission#WAKE_LOCK permission to its manifest.

The primary entry point for this code is the attach(FragmentActivity) method. It should be called with an FragmentActivity as an argument and that FragmentActivity will then be able to receive ambient lifecycle events through an AmbientCallback. The FragmentActivity will also receive a AmbientController object from the attachment which can be used to query the current status of the ambient mode. An example of how to attach AmbientModeSupport to your FragmentActivity and use the AmbientController can be found below:

<code>AmbientMode.AmbientController controller = AmbientMode.attachAmbientSupport(this);
      boolean isAmbient =  controller.isAmbient();
  </code>

Summary

Nested classes
abstract

Callback to receive ambient mode state changes.

abstract

Interface for any Activity that wishes to implement Ambient Mode.

A class for interacting with the ambient mode on a wearable device.

Constants
static String

Property in bundle passed to AmbientCallback#onEnterAmbient(Bundle) to indicate whether burn-in protection is required.

static String

Property in bundle passed to AmbientCallback#onEnterAmbient(Bundle) to indicate whether the device has low-bit ambient mode.

static String

Fragment tag used by default when adding AmbientModeSupport to add ambient support to a FragmentActivity.

Public constructors

Constructor

Public methods
static AmbientModeSupport.AmbientController!
attach(activity: T)

Attach ambient support to the given activity.

Unit
dump(prefix: String, fd: FileDescriptor?, writer: PrintWriter, args: Array<String!>?)

Unit
onAttach(context: Context)

Unit
onCreate(savedInstanceState: Bundle?)

Unit

Unit

Unit

Unit

Unit

Inherited functions