public final class

ColorBuilders.SweepGradient

extends java.lang.Object

implements ColorBuilders.Brush

 java.lang.Object

↳androidx.wear.protolayout.ColorBuilders.SweepGradient

Overview

A sweep gradient with the given colors dispersed around its center with offsets defined in each color stop. The sweep begins at the parent's base angle plus the given angular shift and continues clockwise until it reaches the starting position again.

The gradient center corresponds to center of the parent element.

Summary

Methods
public static ColorBuilders.SweepGradientfromProto(ColorProto.SweepGradient proto, Fingerprint fingerprint)

Creates a new wrapper instance from the proto.

public java.util.List<ColorBuilders.ColorStop>getColorStops()

Gets the color stops defining how the colors are distributed around the gradient center.

public DimensionBuilders.DegreesPropgetEndAngle()

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

public FingerprintgetFingerprint()

public DimensionBuilders.DegreesPropgetStartAngle()

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

public ColorProto.BrushtoBrushProto()

public java.lang.StringtoString()

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

Methods

public java.util.List<ColorBuilders.ColorStop> getColorStops()

Gets the color stops defining how the colors are distributed around the gradient center. The color sequence starts at the start angle and spans 360 degrees clockwise, finishing at the same angle.

A color stop is a pair 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.

There must be at least 2 colors and at most 10 colors.

If offset values are not set, the colors are evenly distributed in the gradient.

public DimensionBuilders.DegreesProp getStartAngle()

Gets 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.

public DimensionBuilders.DegreesProp getEndAngle()

Gets 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.

public Fingerprint getFingerprint()

public static ColorBuilders.SweepGradient fromProto(ColorProto.SweepGradient proto, Fingerprint fingerprint)

Creates a new wrapper instance from the proto.

public ColorProto.Brush toBrushProto()

public java.lang.String toString()