ColorBuilders.ColorProp.Builder


class ColorBuilders.ColorProp.Builder


Builder for ColorProp

Summary

Public constructors

This function is deprecated.

use Builder

Builder(staticValue: @ColorInt Int)

Creates an instance of Builder from the given static value.

Public functions

ColorBuilders.ColorProp

Builds an instance from accumulated values.

ColorBuilders.ColorProp.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setArgb(argb: @ColorInt Int)

Sets the static color value, in ARGB format.

ColorBuilders.ColorProp.Builder
@RequiresSchemaVersion(major = 1, minor = 200)
setDynamicValue(dynamicValue: DynamicBuilders.DynamicColor)

Sets the dynamic value.

Public constructors

Builder

Added in 1.0.0
Deprecated in 1.0.0
Builder()

Creates an instance of Builder.

Builder

Added in 1.0.0
Builder(staticValue: @ColorInt Int)

Creates an instance of Builder from the given static value. setDynamicValue can be used to provide a dynamic value.

Public functions

build

Added in 1.0.0
fun build(): ColorBuilders.ColorProp

Builds an instance from accumulated values.

Throws
java.lang.IllegalStateException

if a dynamic value is set using setDynamicValue but neither Builder nor setArgb is used to provide a static value.

setArgb

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setArgb(argb: @ColorInt Int): ColorBuilders.ColorProp.Builder

Sets the static color value, in ARGB format. If a dynamic value is also set and the renderer supports dynamic values for the corresponding field, this static value will be ignored. If the static value is not specified, zero (equivalent to TRANSPARENT) will be used instead.

setDynamicValue

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
fun setDynamicValue(dynamicValue: DynamicBuilders.DynamicColor): ColorBuilders.ColorProp.Builder

Sets the dynamic value. Note that when setting this value, the static value is still required to be set to support older renderers that only read the static value. If dynamicValue has an invalid result, the provided static value will be used instead.