Builder
class Builder
kotlin.Any | |
↳ | android.hardware.lights.LightState.Builder |
Builder for creating device light change requests.
Summary
Public constructors | |
---|---|
Builder() Creates a new |
Public methods | |
---|---|
LightState |
build() Create a LightState object used to control lights on the device. |
LightState.Builder |
Set the desired color and intensity of the LightState Builder, for a light type of RBG color or single monochrome color. |
LightState.Builder |
setPlayerId(playerId: Int) Set the desired player id of the LightState Builder, for a light with type |
Public constructors
Public methods
build
fun build(): LightState
Create a LightState object used to control lights on the device.
The generated LightState
should be used in LightsRequest.Builder#addLight(Light, LightState)
.
Return | |
---|---|
LightState |
This value cannot be null . |
setColor
fun setColor(color: Int): LightState.Builder
Set the desired color and intensity of the LightState Builder, for a light type of RBG color or single monochrome color.
Parameters | |
---|---|
color |
Int: the desired color and intensity in ARGB format. |
Return | |
---|---|
LightState.Builder |
The LightState.Builder object contains the light color and intensity. This value cannot be null . |
setPlayerId
fun setPlayerId(playerId: Int): LightState.Builder
Set the desired player id of the LightState Builder, for a light with type android.hardware.lights.Light#LIGHT_TYPE_PLAYER_ID
.
Parameters | |
---|---|
playerId |
Int: the desired player id. |
Return | |
---|---|
LightState.Builder |
The LightState.Builder object contains the player id. This value cannot be null . |