ColorBuilders.ColorProp.Builder
public final class ColorBuilders.ColorProp.Builder
Builder for ColorProp
Summary
Public constructors |
|---|
This method is deprecated. use |
|
Creates an instance of |
Public methods |
|
|---|---|
@NonNull ColorBuilders.ColorProp |
build()Builds an instance from accumulated values. |
@NonNull ColorBuilders.ColorProp.Builder |
@RequiresSchemaVersion(major = 1, minor = 0)Sets the static color value, in ARGB format. |
@NonNull ColorBuilders.ColorProp.Builder |
@RequiresSchemaVersion(major = 1, minor = 200)Sets the dynamic value. |
Public constructors
Builder
public Builder(@ColorInt int staticValue)
Creates an instance of Builder from the given static value. setDynamicValue can be used to provide a dynamic value.
Public methods
build
public @NonNull ColorBuilders.ColorProp build()
Builds an instance from accumulated values.
| Throws | |
|---|---|
java.lang.IllegalStateException |
if a dynamic value is set using |
setArgb
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull ColorBuilders.ColorProp.Builder setArgb(@ColorInt int argb)
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
@RequiresSchemaVersion(major = 1, minor = 200)
public @NonNull ColorBuilders.ColorProp.Builder setDynamicValue(@NonNull DynamicBuilders.DynamicColor dynamicValue)
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.