Język

ColorSequence.Builder.AddControlPoint(Int64, Color) Method

Definition

Adds the next control point for the effect.

[Android.Runtime.Register("addControlPoint", "(JI)Landroid/hardware/lights/ColorSequence$Builder;", "", ApiSince=37)]
public Android.Hardware.Lights.ColorSequence.Builder AddControlPoint(long delayMillis, Android.Graphics.Color color);
[<Android.Runtime.Register("addControlPoint", "(JI)Landroid/hardware/lights/ColorSequence$Builder;", "", ApiSince=37)>]
member this.AddControlPoint : int64 * Android.Graphics.Color -> Android.Hardware.Lights.ColorSequence.Builder

Parameters

delayMillis
Int64

transition time for the light to change to the target color.

color
Color

the target color for the light at the end of the transition time.

Returns

a reference to this builder. This value cannot be null.

Attributes

Remarks

Adds the next control point for the effect. The transition between control point colors takes delayMillis milliseconds. During that time, the light colors will be smoothly interpolated from the start to the end value according to the interpolation algorithm and the light's update interval.

When specifying a delay: Any negative value is considered an error and will cause an IllegalArgumentException; Any positive value corresponds to the transition time in milliseconds, relative to the end of the previous control point; A value of 0 can only be specified for the very first control point in the sequence as a way to provide an initial state for the effect. It will cause an IllegalArgumentException if found in any other index; All delays MUST be whole multiples of the light's update period (frame period) (Light.getMinUpdatePeriodMillis()). If any specified delay is a fractional number of frames, the system will truncate the delay potentially altering initially expected interpolation values and relative timing with other lights.

Providing an initial state is not required and the effect will take the last known state as the starting point for the interpolation, creating smooth transitions between effects.

Android reference for android.hardware.lights.ColorSequence.Builder.addControlPoint.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to