LayoutElementBuilders.ArcLine.Builder
public final class LayoutElementBuilders.ArcLine.Builder
Builder for ArcLine
.
Summary
Public methods
build
public @NonNull LayoutElementBuilders.ArcLine build()
Builds an instance with values accumulated in this Builder.
setArcDirection
@RequiresSchemaVersion(major = 1, minor = 300)
public @NonNull LayoutElementBuilders.ArcLine.Builder setArcDirection(int arcDirection)
Sets the direction in which this line is drawn. If not set, defaults to ARC_DIRECTION_CLOCKWISE.
setArcDirection
@RequiresSchemaVersion(major = 1, minor = 300)
public @NonNull LayoutElementBuilders.ArcLine.Builder setArcDirection(
@NonNull LayoutElementBuilders.ArcDirectionProp arcDirection
)
Sets the direction in which this line is drawn. If not set, defaults to ARC_DIRECTION_CLOCKWISE.
setBrush
@RequiresSchemaVersion(major = 1, minor = 300)
public @NonNull LayoutElementBuilders.ArcLine.Builder setBrush(@NonNull ColorBuilders.Brush brush)
Sets a brush used to draw this line. If set, the brush will be used instead of the color provided in setColor()
.
setColor
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull LayoutElementBuilders.ArcLine.Builder setColor(@NonNull ColorBuilders.ColorProp color)
Sets the color of this line.
While this field is statically accessible from 1.0, it's only bindable since version 1.2 and renderers supporting version 1.2 will use the dynamic value (if set).
If a brush is set, this color will not be used.
setLayoutConstraintsForDynamicLength
@RequiresSchemaVersion(major = 1, minor = 200)
public @NonNull LayoutElementBuilders.ArcLine.Builder setLayoutConstraintsForDynamicLength(
@NonNull DimensionBuilders.AngularLayoutConstraint angularLayoutConstraint
)
Sets the bounding constraints for the layout affected by the dynamic value from setLength
.
setLength
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull LayoutElementBuilders.ArcLine.Builder setLength(@NonNull DimensionBuilders.DegreesProp length)
Sets the length of this line, in degrees. If not defined, defaults to 0.
While this field is statically accessible from 1.0, it's only bindable since version 1.2 and renderers supporting version 1.2 will use the dynamic value (if set).
When using a dynamic value, make sure to specify the bounding constraints for the affected layout element through
setLayoutConstraintsForDynamicLength(AngularLayoutConstraint)
otherwise
build()
fails.
setModifiers
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull LayoutElementBuilders.ArcLine.Builder setModifiers(@NonNull ModifiersBuilders.ArcModifiers modifiers)
Sets androidx.wear.protolayout.ModifiersBuilders.Modifiers
for this element.
setStrokeCap
@RequiresSchemaVersion(major = 1, minor = 200)
public @NonNull LayoutElementBuilders.ArcLine.Builder setStrokeCap(int strokeCap)
Sets the line stroke cap. If not defined, defaults to STROKE_CAP_ROUND.
setStrokeCap
@RequiresSchemaVersion(major = 1, minor = 200)
public @NonNull LayoutElementBuilders.ArcLine.Builder setStrokeCap(@NonNull LayoutElementBuilders.StrokeCapProp strokeCap)
Sets the line stroke cap. If not defined, defaults to STROKE_CAP_ROUND.
setThickness
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull LayoutElementBuilders.ArcLine.Builder setThickness(@NonNull DimensionBuilders.DpProp thickness)
Sets the thickness of this line. If not defined, defaults to 0.
Note that this field only supports static values.