DynamicBuilders.DynamicColor


@RequiresSchemaVersion(major = 1, minor = 200)
interface DynamicBuilders.DynamicColor : DynamicBuilders.DynamicType


Interface defining a dynamic color type.

Summary

Public functions

DynamicBuilders.DynamicColor
@RequiresSchemaVersion(major = 1, minor = 200)
animate()

Returns a DynamicColor that is bound to the value of this DynamicColor and every time its value is changing, it animates from its current value to the new value.

DynamicBuilders.DynamicColor
@RequiresSchemaVersion(major = 1, minor = 200)
animate(animationSpec: AnimationParameterBuilders.AnimationSpec)

Returns a DynamicColor that is bound to the value of this DynamicColor and every time its value is changing, it animates from its current value to the new value.

java-static DynamicBuilders.DynamicColor
@RequiresSchemaVersion(major = 1, minor = 200)
animate(dynamicDataKey: DynamicDataKey<DynamicBuilders.DynamicColor!>)

Creates a DynamicColor that is bound to the value of an item of the State.

java-static DynamicBuilders.DynamicColor
@RequiresSchemaVersion(major = 1, minor = 200)
animate(
    dynamicDataKey: DynamicDataKey<DynamicBuilders.DynamicColor!>,
    animationSpec: AnimationParameterBuilders.AnimationSpec
)

Creates a DynamicColor that is bound to the value of an item of the State.

java-static DynamicBuilders.DynamicColor
@RequiresSchemaVersion(major = 1, minor = 200)
animate(start: @ColorInt Int, end: @ColorInt Int)

Creates a DynamicColor which will animate over the range of colors from start to end.

java-static DynamicBuilders.DynamicColor
@RequiresSchemaVersion(major = 1, minor = 200)
animate(
    start: @ColorInt Int,
    end: @ColorInt Int,
    animationSpec: AnimationParameterBuilders.AnimationSpec
)

Creates a DynamicColor which will animate over the range of colors from start to end with the given animation parameters.

java-static DynamicBuilders.DynamicColor
@RequiresSchemaVersion(major = 1, minor = 200)
constant(constant: @ColorInt Int)

Creates a constant-valued DynamicColor.

java-static DynamicBuilders.DynamicColor
@RequiresSchemaVersion(major = 1, minor = 200)
from(dynamicDataKey: DynamicDataKey<DynamicBuilders.DynamicColor!>)

Creates a DynamicColor that is bound to the value of an item of the State.

java-static DynamicBuilders.DynamicColor

Creates a DynamicColor from a byte array generated by toDynamicColorByteArray.

java-static DynamicBuilders.DynamicColor
fromByteArray(byteArray: ByteArray, offset: Int, length: Int)

Creates a DynamicColor from the provided byte array at the provided offset and length, that was generated by one of the toDynamicColorByteArray overloads.

java-static ConditionScopes.ConditionScope<DynamicBuilders.DynamicColor!, Int!>
@RequiresSchemaVersion(major = 1, minor = 200)
onCondition(condition: DynamicBuilders.DynamicBool)

Bind the value of this DynamicColor to the result of a conditional expression.

ByteArray<Byte>

Serializes the DynamicColor into a new byte array that can later be used with fromByteArray.

Int

Serializes the DynamicColor into the provided byte array, returning the amount of bytes written, that can later be used with DynamicColor.fromByteArray(byteArray, 0, bytesWritten).

Int
toDynamicColorByteArray(byteArray: ByteArray, offset: Int, length: Int)

Serializes the DynamicColor into the provided byte array, returning the amount of bytes written, limited by the provided offset and length, that can later be used with DynamicColor.fromByteArray(byteArray, offset, bytesWritten).

Public functions

animate

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
fun animate(): DynamicBuilders.DynamicColor

Returns a DynamicColor that is bound to the value of this DynamicColor and every time its value is changing, it animates from its current value to the new value.

animate

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
fun animate(animationSpec: AnimationParameterBuilders.AnimationSpec): DynamicBuilders.DynamicColor

Returns a DynamicColor that is bound to the value of this DynamicColor and every time its value is changing, it animates from its current value to the new value.

Parameters
animationSpec: AnimationParameterBuilders.AnimationSpec

The animation parameters.

animate

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun animate(dynamicDataKey: DynamicDataKey<DynamicBuilders.DynamicColor!>): DynamicBuilders.DynamicColor

Creates a DynamicColor that is bound to the value of an item of the State. Every time the state value changes, this DynamicColor will animate from its current value to the new value (from the state).

Parameters
dynamicDataKey: DynamicDataKey<DynamicBuilders.DynamicColor!>

The source key to a DynamicDataValue with a color value.

animate

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun animate(
    dynamicDataKey: DynamicDataKey<DynamicBuilders.DynamicColor!>,
    animationSpec: AnimationParameterBuilders.AnimationSpec
): DynamicBuilders.DynamicColor

Creates a DynamicColor that is bound to the value of an item of the State. Every time the state value changes, this DynamicColor will animate from its current value to the new value (from the state).

Parameters
dynamicDataKey: DynamicDataKey<DynamicBuilders.DynamicColor!>

The source key to a DynamicDataValue with a color value.

animationSpec: AnimationParameterBuilders.AnimationSpec

The animation parameters.

animate

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun animate(start: @ColorInt Int, end: @ColorInt Int): DynamicBuilders.DynamicColor

Creates a DynamicColor which will animate over the range of colors from start to end.

Parameters
start: @ColorInt Int

The start value of the range.

end: @ColorInt Int

The end value of the range.

animate

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun animate(
    start: @ColorInt Int,
    end: @ColorInt Int,
    animationSpec: AnimationParameterBuilders.AnimationSpec
): DynamicBuilders.DynamicColor

Creates a DynamicColor which will animate over the range of colors from start to end with the given animation parameters.

Parameters
start: @ColorInt Int

The start value of the range.

end: @ColorInt Int

The end value of the range.

animationSpec: AnimationParameterBuilders.AnimationSpec

The animation parameters.

constant

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun constant(constant: @ColorInt Int): DynamicBuilders.DynamicColor

Creates a constant-valued DynamicColor.

from

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun from(dynamicDataKey: DynamicDataKey<DynamicBuilders.DynamicColor!>): DynamicBuilders.DynamicColor

Creates a DynamicColor that is bound to the value of an item of the State.

Parameters
dynamicDataKey: DynamicDataKey<DynamicBuilders.DynamicColor!>

The source key to a DynamicDataValue with a color value.

fromByteArray

Added in 1.0.0
java-static fun fromByteArray(byteArray: ByteArray): DynamicBuilders.DynamicColor

Creates a DynamicColor from a byte array generated by toDynamicColorByteArray.

Throws
java.lang.IllegalArgumentException

if the byte array does not contain a valid serialization

fromByteArray

Added in 1.0.0
java-static fun fromByteArray(byteArray: ByteArray, offset: Int, length: Int): DynamicBuilders.DynamicColor

Creates a DynamicColor from the provided byte array at the provided offset and length, that was generated by one of the toDynamicColorByteArray overloads.

Throws
java.lang.IllegalArgumentException

if the byte array does not contain a valid serialization in the provided offset and length

onCondition

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun onCondition(condition: DynamicBuilders.DynamicBool): ConditionScopes.ConditionScope<DynamicBuilders.DynamicColor!, Int!>

Bind the value of this DynamicColor to the result of a conditional expression. This will use the value given in either use or elseUse depending on the value yielded from condition.

toDynamicColorByteArray

Added in 1.0.0
fun toDynamicColorByteArray(): ByteArray<Byte>

Serializes the DynamicColor into a new byte array that can later be used with fromByteArray.

toDynamicColorByteArray

Added in 1.0.0
fun toDynamicColorByteArray(byteArray: ByteArray): Int

Serializes the DynamicColor into the provided byte array, returning the amount of bytes written, that can later be used with DynamicColor.fromByteArray(byteArray, 0, bytesWritten).

Throws
java.lang.IllegalArgumentException

if the byte array is too small

toDynamicColorByteArray

Added in 1.0.0
fun toDynamicColorByteArray(byteArray: ByteArray, offset: Int, length: Int): Int

Serializes the DynamicColor into the provided byte array, returning the amount of bytes written, limited by the provided offset and length, that can later be used with DynamicColor.fromByteArray(byteArray, offset, bytesWritten).

Throws
java.lang.IllegalArgumentException

if the byte array is too small