public final class

ColorBuilders.SweepGradient.Builder

extends java.lang.Object

implements ColorBuilders.Brush.Builder

 java.lang.Object

↳androidx.wear.protolayout.ColorBuilders.SweepGradient.Builder

Overview

Builder for ColorBuilders.SweepGradient.

Summary

Constructors
publicBuilder(ColorBuilders.ColorProp colors[])

Creates an instance of ColorBuilders.ColorProp.Builder.

publicBuilder(ColorBuilders.ColorStop colorStops[])

Creates an instance of ColorBuilders.ColorProp.Builder.

Methods
public ColorBuilders.SweepGradientbuild()

Builds an instance from accumulated values.

public ColorBuilders.SweepGradient.BuildersetEndAngle(DimensionBuilders.DegreesProp endAngle)

Sets the end angle of the gradient, relative to the element's base angle.

public ColorBuilders.SweepGradient.BuildersetStartAngle(DimensionBuilders.DegreesProp startAngle)

Sets the start angle of the gradient relative to the element's base angle.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(ColorBuilders.ColorStop colorStops[])

Creates an instance of ColorBuilders.ColorProp.Builder.

Parameters:

colorStops: The color stops defining how the colors are distributed around the gradient center.

A color stop is composed of a color and its offset in the gradient. The offset is the relative position of the color, beginning with 0 from the start angle and ending with 1.0 at the end angle, spanning clockwise.

public Builder(ColorBuilders.ColorProp colors[])

Creates an instance of ColorBuilders.ColorProp.Builder.

The colors are evenly distributed in the gradient.

Parameters:

colors: The color sequence to be distributed around the gradient center. The color sequence is distributed between the gradient's start and end angles.

Methods

Sets the start angle of the gradient relative to the element's base angle. If not set, defaults to zero.

For LayoutElementBuilders.ArcLine, the base angle is the angle where the line starts. The value represents a relative position in the line's length span. Values greater than 360 degrees correspond to upper layers of the arc line as it wraps over itself.

Note that this field only supports static values.

Sets the end angle of the gradient, relative to the element's base angle. If not set, defaults to 360 degrees.

For LayoutElementBuilders.ArcLine, the base angle is the angle where the line starts. The value represents a relative position in the line's length span. Values greater than 360 degrees correspond to upper layers of the arc line as it wraps over itself.

Note that this field only supports static values.

Builds an instance from accumulated values.