LayoutElementBuilders.DashedLinePattern.Builder


public final class LayoutElementBuilders.DashedLinePattern.Builder


Builder for DashedLinePattern

Summary

Public constructors

@RequiresSchemaVersion(major = 1, minor = 500)
Builder()

Creates an instance of Builder.

Public methods

@NonNull LayoutElementBuilders.DashedLinePattern

Builds an instance from accumulated values.

@NonNull LayoutElementBuilders.DashedLinePattern.Builder
@RequiresSchemaVersion(major = 1, minor = 500)
setGapInterval(float gapIntervalInDegrees)

Sets the interval length in degrees between two consecutive gap center locations.

@NonNull LayoutElementBuilders.DashedLinePattern.Builder
@RequiresSchemaVersion(major = 1, minor = 500)
setGapLocations(@NonNull float[] gapLocationsInDegrees)

Sets the list of each gap's center location in degrees.

@NonNull LayoutElementBuilders.DashedLinePattern.Builder
@RequiresSchemaVersion(major = 1, minor = 500)
setGapSize(@Dimension(unit = 0) float gapSizeInDp)

Sets the size in dp of the gap between the segments.

Public constructors

Builder

Added in 1.3.0-alpha04
@RequiresSchemaVersion(major = 1, minor = 500)
public Builder()

Creates an instance of Builder.

Public methods

build

Added in 1.3.0-alpha04
public @NonNull LayoutElementBuilders.DashedLinePattern build()

Builds an instance from accumulated values.

setGapInterval

Added in 1.3.0-alpha04
@RequiresSchemaVersion(major = 1, minor = 500)
public @NonNull LayoutElementBuilders.DashedLinePattern.Builder setGapInterval(float gapIntervalInDegrees)

Sets the interval length in degrees between two consecutive gap center locations. The arc line will have arc line segments with equal length.

The interval could not be shorter than thickness plus gap size.

Note that calling this method will remove all the gap locations set previously with setGapLocations

setGapLocations

@RequiresSchemaVersion(major = 1, minor = 500)
public @NonNull LayoutElementBuilders.DashedLinePattern.Builder setGapLocations(@NonNull float[] gapLocationsInDegrees)

Sets the list of each gap's center location in degrees.

The interval between any two locations could not be shorter than thickness plus gap size.

Note that calling this method will invalidate the previous call of setGapInterval

setGapSize

Added in 1.3.0-alpha04
@RequiresSchemaVersion(major = 1, minor = 500)
public @NonNull LayoutElementBuilders.DashedLinePattern.Builder setGapSize(@Dimension(unit = 0) float gapSizeInDp)

Sets the size in dp of the gap between the segments. If not defined, defaults to 0.