DimensionBuilders.DpProp.Builder
public final class DimensionBuilders.DpProp.Builder
Builder for DpProp.
Summary
Public constructors |
|---|
This method is deprecated. use |
|
Creates an instance of |
Public methods |
|
|---|---|
@NonNull DimensionBuilders.DpProp |
build()Builds an instance from accumulated values. |
@NonNull DimensionBuilders.DpProp.Builder |
@RequiresSchemaVersion(major = 1, minor = 200)Sets the dynamic value, in dp. |
@NonNull DimensionBuilders.DpProp.Builder |
@RequiresSchemaVersion(major = 1, minor = 0)Sets the static value, in dp. |
Public constructors
Builder
public Builder(@Dimension(unit = 0) float 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 DimensionBuilders.DpProp build()
Builds an instance from accumulated values.
| Throws | |
|---|---|
java.lang.IllegalStateException |
if a dynamic value is set using |
setDynamicValue
@RequiresSchemaVersion(major = 1, minor = 200)
public @NonNull DimensionBuilders.DpProp.Builder setDynamicValue(@NonNull DynamicBuilders.DynamicFloat dynamicValue)
Sets the dynamic value, in dp. 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.
setValue
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull DimensionBuilders.DpProp.Builder setValue(@Dimension(unit = 0) float value)
Sets the static value, in dp. 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 will be used instead.