Android.Hardware.Lights Namespace
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides types to discover device lights and request light states and effects.
Classes
| Name | Description |
|---|---|
| ColorSequence |
Models a sequence of colors and their relative timing to create a light effect. |
| ColorSequence.Builder |
Builder for |
| ColorSequence.InterfaceConsts |
Provides the parcelable interface constants exposed by the color sequence binding. |
| Light |
Represents a logical light on the device. |
| Light.InterfaceConsts |
Provides the parcelable interface constants exposed by the light binding. |
| LightsManager |
The LightsManager class allows control over device lights. |
| LightsManager.LightsSession |
Encapsulates a session that can be used to control device lights and represents the lifetime of the requests. |
| LightsRequest |
Encapsulates a request to modify the state of multiple lights. |
| LightsRequest.Builder |
Builder for creating device light change requests. |
| LightState |
Represents the state of a device light. |
| LightState.Builder |
Builder for creating device light change requests. |
| LightState.InterfaceConsts |
Provides the parcelable interface constants exposed by the light state binding. |
| MultiLightEffect |
Models an effect that will be shown in one or more lights. |
| MultiLightEffect.Builder |
Builder for |
| MultiLightEffect.InterfaceConsts |
Provides the parcelable interface constants exposed by the light effect binding. |
Enums
| Name | Description |
|---|---|
| InterpolationMode |
Specifies how a color sequence changes between control point colors. |
| LightCapability |
Specifies the capability flags defined for a device light. |
| LightType |
Identifies the logical purpose of a device light. |
Remarks
Use LightsManager to find lights and open a session. Build a LightsRequest from light states or a light effect, then submit it with RequestLights(LightsRequest).
Color and brightness control depend on the light hardware and are applied on a best-effort basis. Check a light's capabilities before using effects. A light type or capability constant does not establish that a device supports it.
Call Close() when the session is no longer needed. Closing removes that session's requests; the manager can then honor requests from other sessions. It does not promise to restore a previously observed color.
See the Android 17 lights API source.