Light
class Light : Parcelable
| kotlin.Any | |
| ↳ | android.hardware.lights.Light |
Represents a logical light on the device.
Summary
| Constants | |
|---|---|
| static Int |
Capability for lights that could adjust its LED brightness. |
| static Int |
Capability for lights that have red, green and blue LEDs to control the light's color. |
| static Int |
Capability for lights that have red, green and blue LEDs to control the light's color. |
| static Int |
Type for lights that indicate a monochrome color LED light. |
| static Int |
Type for lights that illuminate keyboard keys. |
| static Int |
Type for lights that indicate microphone usage |
| static Int |
Type for lights that indicate a group of LED lights representing player id. |
| Inherited constants | |
|---|---|
| Public methods | |
|---|---|
| Int |
Implement the Parcelable interface |
| Boolean |
Indicates whether some other object is "equal to" this one. |
| Int |
getId()Returns the id of the light. |
| String |
getName()Returns the name of the light. |
| Int |
Returns the ordinal of the light. |
| Int |
getType()Returns the logical type of the light. |
| Boolean |
Check whether the light has led brightness control. |
| Boolean |
Check whether the light has RGB led control. |
| Int |
hashCode()Returns a hash code value for the object. |
| String |
toString()Returns a string representation of the object. |
| Unit |
writeToParcel(dest: Parcel, flags: Int)Implement the Parcelable interface |
| Properties | |
|---|---|
| static Parcelable.Creator<Light!> |
Implement the Parcelable interface |
Constants
LIGHT_CAPABILITY_BRIGHTNESS
static val LIGHT_CAPABILITY_BRIGHTNESS: Int
Capability for lights that could adjust its LED brightness. If the capability is not present the LED can only be turned either on or off.
Value: 1LIGHT_CAPABILITY_COLOR_RGB
static val LIGHT_CAPABILITY_COLOR_RGB: Int
Capability for lights that have red, green and blue LEDs to control the light's color.
Value: 2LIGHT_CAPABILITY_RGB
static valLIGHT_CAPABILITY_RGB: Int
Deprecated: Wrong int based flag with value 0. Use capability flag LIGHT_CAPABILITY_COLOR_RGB instead.
Capability for lights that have red, green and blue LEDs to control the light's color.
Value: 0LIGHT_TYPE_INPUT
static val LIGHT_TYPE_INPUT: Int
Type for lights that indicate a monochrome color LED light.
Value: 10001LIGHT_TYPE_KEYBOARD_BACKLIGHT
static val LIGHT_TYPE_KEYBOARD_BACKLIGHT: Int
Type for lights that illuminate keyboard keys.
Value: 10003LIGHT_TYPE_MICROPHONE
static val LIGHT_TYPE_MICROPHONE: Int
Type for lights that indicate microphone usage
Value: 8LIGHT_TYPE_PLAYER_ID
static val LIGHT_TYPE_PLAYER_ID: Int
Type for lights that indicate a group of LED lights representing player id. Player id lights normally present on game controllers are lights that consist of a row of LEDs. During multi-player game, the player id for the current game controller is represented by one of the LED that is lit according to its position in the row.
Value: 10002Public methods
describeContents
fun describeContents(): Int
Implement the Parcelable interface
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or
|
equals
fun equals(other: Any?): Boolean
Indicates whether some other object is "equal to" this one.
The equals method implements an equivalence relation on non-null object references:
- It is reflexive: for any non-null reference value
x,x.equals(x)should returntrue. - It is symmetric: for any non-null reference values
xandy,x.equals(y)should returntrueif and only ify.equals(x)returnstrue. - It is transitive: for any non-null reference values
x,y, andz, ifx.equals(y)returnstrueandy.equals(z)returnstrue, thenx.equals(z)should returntrue. - It is consistent: for any non-null reference values
xandy, multiple invocations ofx.equals(y)consistently returntrueor consistently returnfalse, provided no information used inequalscomparisons on the objects is modified. - For any non-null reference value
x,x.equals(null)should returnfalse.
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| Parameters | |
|---|---|
obj |
This value may be null. |
| Return | |
|---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getId
fun getId(): Int
Returns the id of the light.
This is an opaque value used as a unique identifier for the light.
getName
fun getName(): String
Returns the name of the light.
| Return | |
|---|---|
String |
This value cannot be null. |
getOrdinal
fun getOrdinal(): Int
Returns the ordinal of the light.
This is a sort key that represents the physical order of lights on the device with the same type. In the case of multiple lights arranged in a line, for example, the ordinals could be [1, 2, 3, 4], or [0, 10, 20, 30], or any other values that have the same sort order.
getType
fun getType(): Int
Returns the logical type of the light.
| Return | |
|---|---|
Int |
Value is one of the following: |
hasBrightnessControl
fun hasBrightnessControl(): Boolean
Check whether the light has led brightness control.
| Return | |
|---|---|
Boolean |
True if the hardware can control the led brightness, otherwise false. |
hasRgbControl
fun hasRgbControl(): Boolean
Check whether the light has RGB led control.
| Return | |
|---|---|
Boolean |
True if the hardware can control the RGB led, otherwise false. |
hashCode
fun hashCode(): Int
Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.
The general contract of hashCode is:
- Whenever it is invoked on the same object more than once during an execution of a Java application, the
hashCodemethod must consistently return the same integer, provided no information used inequalscomparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. - If two objects are equal according to the
equalsmethod, then calling thehashCodemethod on each of the two objects must produce the same integer result. - It is not required that if two objects are unequal according to the
equalsmethod, then calling thehashCodemethod on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
| Return | |
|---|---|
Int |
a hash code value for this object. |
toString
fun toString(): String
Returns a string representation of the object.
| Return | |
|---|---|
String |
a string representation of the object. |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Implement the Parcelable interface
| Parameters | |
|---|---|
dest |
Parcel: This value cannot be null. |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of the following:
|
Properties
CREATOR
static val CREATOR: Parcelable.Creator<Light!>
Implement the Parcelable interface