Added in API level 31

Builder

class Builder
kotlin.Any
   ↳ android.hardware.lights.LightsRequest.Builder

Builder for creating device light change requests.

Summary

Public constructors

Public methods
LightsRequest.Builder
addLight(light: Light, state: LightState)

Overrides the color and intensity of a given light.

LightsRequest

Create a LightsRequest object used to override lights on the device.

LightsRequest.Builder
clearLight(light: Light)

Removes the override for the color and intensity of a given light.

Public constructors

Builder

Builder()

Public methods

addLight

Added in API level 31
fun addLight(
    light: Light,
    state: LightState
): LightsRequest.Builder

Overrides the color and intensity of a given light.

Parameters
light Light: the light to modify This value cannot be null.
state LightState: the desired color and intensity of the light This value cannot be null.
Return
LightsRequest.Builder This value cannot be null.

build

fun build(): LightsRequest

Create a LightsRequest object used to override lights on the device.

The generated LightsRequest should be used in LightsManager.Session#requestLights(LightsLightsRequest)

clearLight

Added in API level 31
fun clearLight(light: Light): LightsRequest.Builder

Removes the override for the color and intensity of a given light.

Parameters
light Light: the light to modify This value cannot be null.
Return
LightsRequest.Builder This value cannot be null.